Forum Discussion
2 Replies
Sort By
- hwidjaja_37598AltostratusI think you need to create a script and use a cron job to periodically synchronize the configuration.
!/usr/bin/perl use BigDB; use strict; my ($LockFile) = "/tmp/autocs.lck"; my ($bigpipe) = "/bin/bigpipe"; my ($Status); Exit when lock file is exist, to prevent launching duplicate process if (-f $LockFile){ print "Another process is currently running ... \n"; exit 0; } Creating lock file open (fil, ">$LockFile") || die "error creating lock file $LockFile"; close (fil); Open BigDB my ($hBigDB, $Status) = &bigdb_open; &CheckErr('Error: bigdb_open'); If Configsync.State is not Synchronized and the script is run from active unit then do ConfigSync if ( &BigDB("Configsync.State") !~ /synchronized/i && system("/usr/bin/failover_status | grep -vi active >/dev/null") ){ If LocalConfigTime is bigger than PeerConfigTime then Push Mode Else Pull Mode if ( &BigDB("Configsync.LocalConfigTime") > &BigDB("Configsync.PeerConfigTime") ) { system "$bigpipe config sync"; } else { system "$bigpipe config sync pull"; } } close bigdb &bigdb_close; Remove lock file unlink $LockFile; exit 0; sub BigDB { my ($Key) = @_; my ($Val, $Status) = &bigdb_fetch($hBigDB, $Key); &CheckErr("Error: BigDB ($Key)"); return ($Val); } sub CheckErr { if ($Status) { print $_[0]; exit $Status; } }
- dennypayneEmployeeThe reason I don't like doing this is twofold: