X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=src%2Fbackupninja.in;h=2a1b76ebae4c1d512a6a3f800a92a7e9573cc326;hp=25f4e1140b3f8f8e6cc23a5928a9904e7a364ed3;hb=a1c625fcc3c1bdcc81bb23aee3bea95051d6cc20;hpb=c4f2b1d45ecbd76342d124768b09f9f26a3b6770 diff --git a/src/backupninja.in b/src/backupninja.in index 25f4e11..2a1b76e 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -98,7 +98,7 @@ function printmsg() { function logmsg() { if [ -w "$logfile" ]; then - echo -e `date "+%h %d %H:%M:%S"` "$@" >> $logfile + echo -e `LC_ALL=C date "+%h %d %H:%M:%S"` "$@" >> $logfile fi } @@ -200,14 +200,17 @@ function toint() { # we grab the current time once, since processing # all the configs might take more than an hour. -nowtime=`date +%H` -nowday=`date +%d` -nowdayofweek=`date +%A` +nowtime=`LC_ALL=C date +%H` +nowday=`LC_ALL=C date +%d` +nowdayofweek=`LC_ALL=C date +%A` nowdayofweek=`tolower "$nowdayofweek"` function isnow() { local when="$1" set -- $when + + [ "$when" == "manual" ] && return 0 + whendayofweek=$1; at=$2; whentime=$3; whenday=`toint "$whendayofweek"` whendayofweek=`tolower "$whendayofweek"` @@ -298,9 +301,9 @@ function process_action() { ret=$? IFS=$'\t\n' if [ $ret == 0 ]; then - debug "skipping $file because it is not $w" + debug "skipping $file because current time does not match $w" else - info ">>>> starting action $file (because it is $w)" + info ">>>> starting action $file (because current time matches $w)" run="yes" fi done