tstamp=$(echo $oldbackup | cut -d'-' -f1)
if [ $(( $(date +%s) - $tstamp )) -lt \
- $(( $BACKUP_RUNEVERYNTHDAY*24*60*60 )) ]
+ $(( ($BACKUP_RUNEVERYNTHDAY*24+12)*60*60 )) ]
then
return 1
fi
done
ssh255 $REMOTE_HOST exit
-
- if isNthDay; then
+
+ if latestTooOld; then
+ scottyerror "The latest backup is too old."
+ elif isNthDay; then
scottyinfo "This is the nth day."
- elif latestTooOld; then
- scottyinfo "The latest backup is too old."
else
scottyinfo "No backup has to be done. Exiting."
exit 0