Brian_Yeager_12
Sep 11, 2008Nimbostratus
Config Sync with Cron
I'm running a few LTM's on 9.2.4. I'm trying to setup a cron job to automatically sync the active to the standby device every x amount of time. I found this script in some other forums:
!/bin/sh
for Status in $(bigpipe failover show | grep -c "The failover state is ACTIVE")
do
if [ $Status -eq 1 ]
then
/bin/bigpipe configsync all
else
echo "This unit is currently in Standby mode" >> /var/logsync.log
fi
done
Seems to work except I believe it was written for 4.x and the bigpipe failover show command no longer returns "The failover state is ACTIVE" or standby. Instead, it returns "FAILOVER active for xxx days", regardless of if you're on the active or standby device.
Is there an equivalent command that returns active or standby that I could substitute in this script in order to make it work? Alternatively, is there another way to go about this script that will work?
I appreciate any help.
===============================================
Edit: This is the corrected script if anyone finds they need it.
!/bin/sh
for Status in $(bigpipe failover show | grep -c "FAILOVER active")
do
if [ $Status -eq 1 ]
then
/bin/bigpipe configsync all
else
echo "This unit is currently in Standby mode" >> /var/logsync.log
fi
done