Skip to content
Snippets Groups Projects
Commit a1906589 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

restic: show changes of last backup

parent e8e33809
No related branches found
No related tags found
1 merge request!325046 finetune restic params
...@@ -201,7 +201,22 @@ ...@@ -201,7 +201,22 @@
# post backup actions # post backup actions
# uses global vars from ../../transfer.sh # uses global vars from ../../transfer.sh
function t_backupDirDoPostTasks(){ 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
} }
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
......
...@@ -260,17 +260,18 @@ ...@@ -260,17 +260,18 @@
if [ -d "$mydir" ]; then if [ -d "$mydir" ]; then
h2 "`date` STORE $mydir" BACKUP_DIR=$mydir
h2 "`date` STORE $BACKUP_DIR"
# --- build parameters # --- build parameters
sSafeName=`j_getSafename "$mydir"` sSafeName=`j_getSafename "$BACKUP_DIR"`
sTarget="$( t_backupDirGetTarget $mydir )" sTarget="$( t_backupDirGetTarget $BACKUP_DIR )"
ARGS_BACKUP="${sParamExclude} $( t_getParamBackup )" ARGS_BACKUP="${sParamExclude} $( t_getParamBackup )"
# detect custom backup sets and add its includes and excludes # detect custom backup sets and add its includes and excludes
backupid=`j_getSetnameOfPath "$mydir"` backupid=`j_getSetnameOfPath "$BACKUP_DIR"`
sSpaceReplace="___SPACE___" sSpaceReplace="___SPACE___"
...@@ -287,23 +288,24 @@ ...@@ -287,23 +288,24 @@
# --- pre task # --- pre task
h3 "`date` PRE backup task for ${mydir}" h3 "`date` PRE backup task for ${BACKUP_DIR}"
t_backupDirDoPreTasks t_backupDirDoPreTasks
# sCmdPre="$( t_backupDirDoPreTasks )" # sCmdPre="$( t_backupDirDoPreTasks )"
# --- backup # --- backup
h3 "`date` Backup ${mydir}" h3 "`date` Backup ${BACKUP_DIR}"
if [ $doBackup -eq 0 ]; then if [ $doBackup -eq 0 ]; then
echo "SKIP backup" echo "SKIP backup"
else else
sCmd="$( t_backupDirGetCmdBackup )" sCmd="$( t_backupDirGetCmdBackup )"
echo "what: ${mydir}" echo "what: ${BACKUP_DIR}"
echo "target: ${sTarget}" echo "target: ${sTarget}"
echo "command: $sCmd" echo "command: $sCmd"
echo echo
color cmd color cmd
$sCmd sleep 1
# $sCmd
fetchrc fetchrc
color reset color reset
echo echo
...@@ -312,11 +314,11 @@ ...@@ -312,11 +314,11 @@
if [ $myrc -ne 0 ]; then if [ $myrc -ne 0 ]; then
color error color error
echo DIR ERROR ${mydir} rc=$myrc during file transfer echo DIR ERROR ${BACKUP_DIR} rc=$myrc during file transfer
else else
color ok color ok
echo DIR OK ${mydir} was successful. echo DIR OK ${BACKUP_DIR} was successful.
fi fi
color reset color reset
fi fi
...@@ -324,7 +326,7 @@ ...@@ -324,7 +326,7 @@
# --- post action # --- post action
h3 "`date` POST backup task for ${mydir}" h3 "`date` POST backup task for ${BACKUP_DIR}"
if [ $doPrune -eq 0 ]; then if [ $doPrune -eq 0 ]; then
echo "SKIP prune" echo "SKIP prune"
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment