Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
a1906589
Commit
a1906589
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
restic: show changes of last backup
parent
e8e33809
Branches
Branches containing commit
No related tags found
1 merge request
!32
5046 finetune restic params
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/transfer/restic.sh
+16
-1
16 additions, 1 deletion
plugins/transfer/restic.sh
transfer.sh
+13
-11
13 additions, 11 deletions
transfer.sh
with
29 additions
and
12 deletions
plugins/transfer/restic.sh
+
16
−
1
View file @
a1906589
...
...
@@ -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
}
# --------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
transfer.sh
+
13
−
11
View file @
a1906589
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment