From: Sugar Labs BOFH Date: Sun, 17 May 2015 05:40:58 +0000 (-0400) Subject: Merge branch 'master' of ssh://codewiz.org/git/bernie/wizbackup X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=1b809305fba27877226fe2de759cf9dc889b4b07;p=wizbackup.git Merge branch 'master' of ssh://codewiz.org/git/bernie/wizbackup Conflicts: wizbackup --- 1b809305fba27877226fe2de759cf9dc889b4b07 diff --cc wizbackup index c88cc7e,0656128..39534ac --- a/wizbackup +++ b/wizbackup @@@ -4,7 -4,7 +4,7 @@@ # Based on incremental-backup 0.1 by Matteo Mattei # # Copyright 2006 Matteo Mattei - # Copyright 2007, 2008, 2009, 2010, 2011, 2015 Bernie Innocenti -# Copyright 2007, 2008, 2009, 2010, 2011, 2012 Bernie Innocenti ++# Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2015 Bernie Innocenti # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@@ -49,14 -51,12 +51,17 @@@ MONTHS= MIN_FREE_GB=10 RESULT=500 -DATE=`date +"%Y%m%d"` +DATE=$(date +"%Y%m%d") +if [ $(date +"%d") = 1 ]; then + DATE="$DATE-monthly" +elif [ $(date +"%w") = 0 ]; then + DATE="$DATE-weekly" +fi DEST="`echo $DEST | sed -e 's/\/$//'`" + if [ -f "$CONF_FILE" ]; then + source /etc/wizbackup/wizbackup.conf + fi # Use "backup" ssh key with ssh protocol, or password file for rsync protocol if [ "${SRC%:*}" == "rsync" ]; then @@@ -168,12 -173,10 +173,12 @@@ do_test() # make sure to be root if (( `id -u` != 0 )); then { echo "Sorry, must be root. Exiting..."; exit; } fi - echo "$(date): BEGIN backup: $SRC -> $DEST" + echo "$(date): BEGIN backup: $0 $@" echo "$(date): $0 $SRC $DEST $@" do_init -do_prune +do_prune 6 "" +do_prune 4 "-weekly" +do_prune $MONTHS "-monthly" do_test do_link do_backup