Hi,
I'm running LNS version 7.1.4 on a Sun-Solaris 9 server
and Networker Client 7.1.4 on a Sun Solaris 10 local zone (Host "B") and I have a problem using pre- and postbackup by savepnpc:
I have this pre-backup script on host "b", running via savepnpc:
------------8><-------------------
TIME=`date '+Datum: %m/%d/%y Zeit:%H:%M:%S'`
STATUSFILE=/appl/scripts/semaphore/BackupPermissionFile
RETRY=12
SLEEP=15
(( SLEEP = SLEEP * 60 ))
echo $SLEEP
echo "**********************************************"
echo "*"
echo " $0: Start pre-backup script ${TIME}"
LOOP=0
while (( LOOP < RETRY ))
do
if [ -f ${STATUSFILE} ] ;then
echo " $0: Statusfile found...starting backup..."
exit 0
fi
echo " $0: `date '+Datum: %m/%d/%y Zeit:%H:%M:%S%t STATFILE not there... waiting'`"
sleep ${SLEEP}
(( LOOP = LOOP + 1 ))
echo $LOOP
done
echo " $0: Timeout reached! Backup failed!"
exit 1
------------8><-------------------
I have a separated savegroup including only one client (client "B"),
the client is configred to run the "savepnpc -ix" command for only two directories (one of them may include further -frequently changing- mountpoints, therefor the -x option, -i option is required to shake out a .nsr directive)
What's the goal of this solution:
somewhere before the backup ist scheduled by LNS, an offline-DB-Sync from host "A" to host "B" took place (Pre-production Job)
as soon as the sync is over, the sync-job touches the ${STATUSFILE}
Because this end of sync could be somewhere between 00:00 and 3:00 am. the savegrp starts at 00:00 am. and looks for the ${STATUSFILE}
What the pre-backup-script should do:
started as prebackup.cmd at 00:00 am. it looks for ${STATUSFILE} and if it's not there it'll wait 15 minutes
( sleep ${SLEEP} ]
if this check failes 12 times (LOOP < $RETRY) pre-backup-script will terminate with exit-code 1 and the savegrp.res script will skip the backup and continue with the post-backup-script (just deleting the ${STATUSFILE} file)
otherwise pre-backup script will terminate with exit-code 0
and the savegrp.res script will continue with the backup as configured by client-setup and will then continue with the post-backip-script
So, in normal situations savegrp would start at 00:00 am and latestly finished at 3:00 am (incase there is no status-file) and that's it.
What unexpectedly happends is that somehow it'll restart at 3:00 am again..than at 6:00 am again....
even though there is no retry configured in the savegrp.
I'll post the savegrp.tes file as well:
type: savepnpc;
precmd: "/nsr/res/prebackup.cmd >> /nsr/logs/prebackup.log 2>&1";
pstcmd: "/nsr/res/postbackup.cmd >> /nsr/logs/prebackup.log 2>&1";
timeout: "12:00:00";
abort precmd with group: No;
any clue?
I'm running LNS version 7.1.4 on a Sun-Solaris 9 server
and Networker Client 7.1.4 on a Sun Solaris 10 local zone (Host "B") and I have a problem using pre- and postbackup by savepnpc:
I have this pre-backup script on host "b", running via savepnpc:
------------8><-------------------
TIME=`date '+Datum: %m/%d/%y Zeit:%H:%M:%S'`
STATUSFILE=/appl/scripts/semaphore/BackupPermissionFile
RETRY=12
SLEEP=15
(( SLEEP = SLEEP * 60 ))
echo $SLEEP
echo "**********************************************"
echo "*"
echo " $0: Start pre-backup script ${TIME}"
LOOP=0
while (( LOOP < RETRY ))
do
if [ -f ${STATUSFILE} ] ;then
echo " $0: Statusfile found...starting backup..."
exit 0
fi
echo " $0: `date '+Datum: %m/%d/%y Zeit:%H:%M:%S%t STATFILE not there... waiting'`"
sleep ${SLEEP}
(( LOOP = LOOP + 1 ))
echo $LOOP
done
echo " $0: Timeout reached! Backup failed!"
exit 1
------------8><-------------------
I have a separated savegroup including only one client (client "B"),
the client is configred to run the "savepnpc -ix" command for only two directories (one of them may include further -frequently changing- mountpoints, therefor the -x option, -i option is required to shake out a .nsr directive)
What's the goal of this solution:
somewhere before the backup ist scheduled by LNS, an offline-DB-Sync from host "A" to host "B" took place (Pre-production Job)
as soon as the sync is over, the sync-job touches the ${STATUSFILE}
Because this end of sync could be somewhere between 00:00 and 3:00 am. the savegrp starts at 00:00 am. and looks for the ${STATUSFILE}
What the pre-backup-script should do:
started as prebackup.cmd at 00:00 am. it looks for ${STATUSFILE} and if it's not there it'll wait 15 minutes
( sleep ${SLEEP} ]
if this check failes 12 times (LOOP < $RETRY) pre-backup-script will terminate with exit-code 1 and the savegrp.res script will skip the backup and continue with the post-backup-script (just deleting the ${STATUSFILE} file)
otherwise pre-backup script will terminate with exit-code 0
and the savegrp.res script will continue with the backup as configured by client-setup and will then continue with the post-backip-script
So, in normal situations savegrp would start at 00:00 am and latestly finished at 3:00 am (incase there is no status-file) and that's it.
What unexpectedly happends is that somehow it'll restart at 3:00 am again..than at 6:00 am again....
even though there is no retry configured in the savegrp.
I'll post the savegrp.tes file as well:
type: savepnpc;
precmd: "/nsr/res/prebackup.cmd >> /nsr/logs/prebackup.log 2>&1";
pstcmd: "/nsr/res/postbackup.cmd >> /nsr/logs/prebackup.log 2>&1";
timeout: "12:00:00";
abort precmd with group: No;
any clue?