Hi gurus,
I am currently using legato 7.1.2.
I am trying to backup a unix server and by means of savepmpc, I created shell scripts for prebackup , ostbackup.
The idea is to copy the data for backup to a temp directory (prebackup) and from there I will proceed with the backup and finally when the backup is finished, the script postbackup will delete the data from the temp folders.
The scripts run perfectly when the backup runs successfully, but I discovered something :in case backup fails, the post script will still be activated.
Is there anyway to prevent the post script from runing once an error in backup is detected?
My prebackup script:
touch /windata/backup/start_prebackup_script
mkdir /windata/backup/ade
mkdir /windata/backup/ade/ade-bin
mkdir /windata/backup/ade/ade-sam
mkdir /windata/backup/ade/epi
mkdir /windata/backup/ade/lotting
mkdir /windata/backup/ade/mws
cd /nfsdata/ade/dat
find ade-bin/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find ade-sam/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find epi/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find lotting/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find mws/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
touch /windata/backup/begin_actual_backup
exit 0
My postbackup script
cd /windata/backup
rm * -f -r
touch BackupComplete
Any advise will be appreciated.
Thanks.
But when simulation, abort backup -> the post command is activated.
I am currently using legato 7.1.2.
I am trying to backup a unix server and by means of savepmpc, I created shell scripts for prebackup , ostbackup.
The idea is to copy the data for backup to a temp directory (prebackup) and from there I will proceed with the backup and finally when the backup is finished, the script postbackup will delete the data from the temp folders.
The scripts run perfectly when the backup runs successfully, but I discovered something :in case backup fails, the post script will still be activated.
Is there anyway to prevent the post script from runing once an error in backup is detected?
My prebackup script:
touch /windata/backup/start_prebackup_script
mkdir /windata/backup/ade
mkdir /windata/backup/ade/ade-bin
mkdir /windata/backup/ade/ade-sam
mkdir /windata/backup/ade/epi
mkdir /windata/backup/ade/lotting
mkdir /windata/backup/ade/mws
cd /nfsdata/ade/dat
find ade-bin/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find ade-sam/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find epi/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find lotting/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
find mws/ -name \* -mtime +149 -exec cp {} /windata/backup/ade/{} \;
touch /windata/backup/begin_actual_backup
exit 0
My postbackup script
cd /windata/backup
rm * -f -r
touch BackupComplete
Any advise will be appreciated.
Thanks.
But when simulation, abort backup -> the post command is activated.