diff --git a/plugins/transfer/restic.sh b/plugins/transfer/restic.sh index 109ab44e623c67f2f8a26ffa835023042eacf922..3433874828e22b0bf1661d914c262cfed092b323 100644 --- a/plugins/transfer/restic.sh +++ b/plugins/transfer/restic.sh @@ -201,7 +201,22 @@ # post backup actions # uses global vars from ../../transfer.sh function t_backupDirDoPostTasks(){ - echo "Nothing to do." + echo "--- SHOW CHANGES between last 2 snapshots" + local _data + local _snapshotLast + local _snapshotNow + + # get list of snapshots and filter the lines with a date YYYY-MM-DD + _data=$( t_restoreDoShowVolumes | grep "[12][0-9][0-9][0-1]-[0-2][0-9]-[0-3][0-9]" | tail -2 ) + + _snapshotLast=$( echo "$_data" | head -1 | cut -f 1 -d " ") + _snapshotNow=$( echo "$_data" | tail -1 | cut -f 1 -d " ") + echo "$_data" + color cmd + restic diff "${_snapshotLast}" "${_snapshotNow}" + color reset + echo + } # -------------------------------------------------------------------------------- diff --git a/transfer.sh b/transfer.sh index 70b2ba3d1895f53928333acfb81cc7494b9f38dd..4e04f917c7453558bb784993fffaa140952e28f3 100755 --- a/transfer.sh +++ b/transfer.sh @@ -260,17 +260,18 @@ if [ -d "$mydir" ]; then - h2 "`date` STORE $mydir" + BACKUP_DIR=$mydir + h2 "`date` STORE $BACKUP_DIR" # --- build parameters - sSafeName=`j_getSafename "$mydir"` - sTarget="$( t_backupDirGetTarget $mydir )" + sSafeName=`j_getSafename "$BACKUP_DIR"` + sTarget="$( t_backupDirGetTarget $BACKUP_DIR )" ARGS_BACKUP="${sParamExclude} $( t_getParamBackup )" # detect custom backup sets and add its includes and excludes - backupid=`j_getSetnameOfPath "$mydir"` + backupid=`j_getSetnameOfPath "$BACKUP_DIR"` sSpaceReplace="___SPACE___" @@ -287,23 +288,24 @@ # --- pre task - h3 "`date` PRE backup task for ${mydir}" + h3 "`date` PRE backup task for ${BACKUP_DIR}" t_backupDirDoPreTasks # sCmdPre="$( t_backupDirDoPreTasks )" # --- backup - h3 "`date` Backup ${mydir}" + h3 "`date` Backup ${BACKUP_DIR}" if [ $doBackup -eq 0 ]; then echo "SKIP backup" else sCmd="$( t_backupDirGetCmdBackup )" - echo "what: ${mydir}" + echo "what: ${BACKUP_DIR}" echo "target: ${sTarget}" echo "command: $sCmd" echo color cmd - $sCmd + sleep 1 + # $sCmd fetchrc color reset echo @@ -312,11 +314,11 @@ if [ $myrc -ne 0 ]; then color error - echo DIR ERROR ${mydir} rc=$myrc during file transfer + echo DIR ERROR ${BACKUP_DIR} rc=$myrc during file transfer else color ok - echo DIR OK ${mydir} was successful. + echo DIR OK ${BACKUP_DIR} was successful. fi color reset fi @@ -324,7 +326,7 @@ # --- post action - h3 "`date` POST backup task for ${mydir}" + h3 "`date` POST backup task for ${BACKUP_DIR}" if [ $doPrune -eq 0 ]; then echo "SKIP prune" else