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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
a6dc2f2b
Commit
a6dc2f2b
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
added restic prune
parent
298b28e2
No related branches found
No related tags found
1 merge request
!73
add restic prune
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/transfer/restic.sh
+28
-1
28 additions, 1 deletion
plugins/transfer/restic.sh
with
28 additions
and
1 deletion
plugins/transfer/restic.sh
+
28
−
1
View file @
a6dc2f2b
...
...
@@ -13,6 +13,7 @@
# 2022-02-09 ah v0.3 update pruning; more keep-params
# 2022-03-07 ah v0.4 add verify in post task
# 2022-05-10 ah v0.5 fix handling with nocache flag (use globally as default param - not in backup only)
# 2022-05-16 ah v0.6 added restic prune
# ================================================================================
# --------------------------------------------------------------------------------
...
...
@@ -148,6 +149,7 @@
# uses global vars from ../../transfer.sh
function
t_backupDoPostTasks
(){
# --------------------
echo
"--- UNLOCK ... just in case :-)"
echo
restic unlock
${
ARGS_DEFAULT
}
color cmd
...
...
@@ -155,7 +157,8 @@
color reset
echo
echo
"--- PRUNE"
# --------------------
echo
"--- FORGET some data"
local
_tag
=
$(
_j_getvar
${
STORAGEFILE
}
"
${
CFGPREFIX
}
tag"
)
local
_mycmd
=
"restic forget
\
...
...
@@ -184,6 +187,20 @@
t_rcCheckCleanup
$_myrc
echo
# --------------------
echo
"--- PRUNE"
_mycmd
=
"restic prune
${
ARGS_DEFAULT
}
"
echo
$_mycmd
sleep
3
color cmd
eval
$_mycmd
local
_myrc
=
$?
color reset
t_rcCheckPrune
$_myrc
echo
# --------------------
echo
"--- VERIFY"
# param --read-data takes a long time. Maybe use an extra job with it.
# _mycmd="time restic check ${ARGS_DEFAULT} --with-cache --read-data"
...
...
@@ -377,6 +394,16 @@
}
# verify backup data
# param integer exitcode of command
function
t_rcCheckPrune
(){
echo
-n
"__PRUNE__ "
case
$1
in
0
)
color ok
;
echo
"OK"
;;
*
)
color error
;
echo
"FAILED - returncode was
$1
"
;;
esac
color reset
}
# verify backup data
# param integer exitcode of command
function
t_rcCheckVerify
(){
echo
-n
"__VERIFY__ "
case
$1
in
...
...
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