From 3ad89747300d526bcab402095a78564d8426eb34 Mon Sep 17 00:00:00 2001 From: lookshe Date: Fri, 12 Sep 2014 11:07:35 +0200 Subject: logfile was only written on connection errors and not as planned if there were no errors --- backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index 95d836c..afbe8e1 100755 --- a/backup.sh +++ b/backup.sh @@ -46,7 +46,7 @@ function rsync_server { echo "$filefrom" | grep ".month." > /dev/null 2>&1 ret2=$? # on monthly backups and connection errors there should be no update of logfile - if [ $ret2 -ne 0 -a $ret -ne 0 ] + if [ $ret2 -ne 0 -a $ret -e 0 ] then sed -e "s/^$logfileentry .*$/${logfileentry} $backup_time/" "$logfile" > "$logfile.tmp" mv -f "$logfile.tmp" "$logfile" -- cgit v1.2.3