ARCHIVE_KEEPNDAYS=30
BACKUP_RUNEVERYNTHDAY=1
BWLIMIT=500KiB
+BACKUP_FORCE=0
_ERROR_ENCOUNTERED=0
Recognized options:
-q Only output errors
-n Run only on nth day
+ -f Force backup
-h Print out this help
EOF
}
function backmeupscotty {
- while getopts "qn:h" opt; do
+ while getopts "qn:fh" opt; do
case $opt in
q)
exec > /dev/null
n)
BACKUP_RUNEVERYNTHDAY=$OPTARG
;;
+ f)
+ BACKUP_FORCE=1
+ ;;
h)
printhelp
exit 0
ssh255 $REMOTE_HOST exit
- if latestTooOld; then
+ if [ $BACKUP_FORCE -eq 1 ]; then
+ scottyinfo "Backup was enforced."
+ elif latestTooOld; then
scottyerror "The latest backup is too old."
elif isNthDay; then
scottyinfo "This is the nth day."