]> arthur.barton.de Git - backup-script.git/blobdiff - bin/backup-script
Write more information to "stamp file"
[backup-script.git] / bin / backup-script
index 71a17cf8c12aae63017a6e1b4c74285bc3abf74c..494efca1dfa37a818d913e06797ea48ca56cc136 100755 (executable)
@@ -596,11 +596,22 @@ for f in $sys; do
        ok=0
 
        if [ "$DRYRUN" -eq 0 ]; then
-               rm -f "$sys_target/.stamp"
+               stamp_file="$sys_target/.stamp"
+               rm -f "$stamp_file"
+
+               # Execute backup command:
+               start_t=$(date "+%s")
                $SHELL -c "$cmd"; ret=$?
-               echo "code=$ret" >"$sys_target/.stamp"
+               end_t=$(date "+%s")
+
+               echo "code=$ret" >"$stamp_file"
+               echo "start_t=$start_t" >>"$stamp_file"
+               echo "end_t=$end_t" >>"$stamp_file"
+               echo "cmd='$cmd'" >>"$stamp_file"
+               echo "backup_host='`hostname -f`'" >>"$stamp_file"
+               echo "backup_user='`id -un`'" >>"$stamp_file"
        else
-               echo " *** Trial run, not executing synchronization command!"
+               echo " *** Trial run, not executing save command!"
                ret=0
        fi