X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=backupninja;h=a59d40067c9eafa3be4e183ee2d0f34ef2b34c9f;hb=1062a550a260fe7fa57baa1c0cfb7d30891518fb;hp=ac504d605af123ae0f471f9f3e2ce457e511d90d;hpb=fb77e731737f3ca96f1295f9ee1f9f58278da84e;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/backupninja b/backupninja index ac504d6..a59d400 100755 --- a/backupninja +++ b/backupninja @@ -199,9 +199,9 @@ function isnow() { whendayofweek=$1; at=$2; whentime=$3; whenday=`toint "$whendayofweek"` whendayofweek=`tolower "$whendayofweek"` - whentime=`echo "$whentime" | sed 's/:[0-9][0-9]$//'` + whentime=`echo "$whentime" | sed 's/:[0-9][0-9]$//' | sed -r 's/^([0-9])$/0\1/'` - if [ "$whendayofweek" == "everyday" ]; then + if [ "$whendayofweek" == "everyday" -o "$whendayofweek" == "daily" ]; then whendayofweek=$nowdayofweek fi @@ -267,6 +267,8 @@ function process_action() { getconf when "$defaultwhen" if [ "$processnow" == 1 ]; then info "running $file because of --now" + elif [ "$when" == "hourly" ]; then + debug "running $file because 'when = hourly'" else IFS=$'\t\n' for w in $when; do @@ -408,6 +410,7 @@ getconf GZIP /bin/gzip getconf RSYNC /usr/bin/rsync [ -d "$configdirectory" ] || fatal "Configuration directory '$configdirectory' not found." +[ -f "$logfile" ] || touch $logfile if [ "$UID" != "0" ]; then echo "$0 can only be run as root"