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
Branches
No related tags found
1 merge request!325046 finetune restic params
......@@ -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
}
# --------------------------------------------------------------------------------
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment