From aba5624aa96d65abdd38ddefd137ca9ef4270243 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 24 Nov 2015 14:17:52 +0100 Subject: [PATCH] Write more information to "stamp file" --- bin/backup-script | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/backup-script b/bin/backup-script index 575fb96..494efca 100755 --- a/bin/backup-script +++ b/bin/backup-script @@ -596,9 +596,20 @@ 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 save command!" ret=0 -- 2.39.2