aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2014-09-12 11:07:35 +0200
committerlookshe <github@lookshe.org>2014-09-12 11:07:35 +0200
commit3ad89747300d526bcab402095a78564d8426eb34 (patch)
treeff3819919990739572e37656a1e0766fb2d6c060
parente848de475ed73d71050980a6d3b3b59271c53344 (diff)
logfile was only written on connection errors and not as planned if there were no errors
-rwxr-xr-xbackup.sh2
1 files changed, 1 insertions, 1 deletions
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"