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
c3f14217
Commit
c3f14217
authored
4 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update transfer plugins
parent
e6a61d1d
No related branches found
No related tags found
1 merge request
!1
Version 2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plugins/transfer/_template.sh
+10
-0
10 additions, 0 deletions
plugins/transfer/_template.sh
plugins/transfer/duplicity.sh
+33
-0
33 additions, 0 deletions
plugins/transfer/duplicity.sh
plugins/transfer/restic.sh
+53
-1
53 additions, 1 deletion
plugins/transfer/restic.sh
with
96 additions
and
1 deletion
plugins/transfer/_template.sh
+
10
−
0
View file @
c3f14217
...
@@ -125,6 +125,16 @@
...
@@ -125,6 +125,16 @@
function
t_sd_cmdPost
(){
function
t_sd_cmdPost
(){
}
}
# --------------------------------------------------------------------------------
# RESTORE
# --------------------------------------------------------------------------------
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function
t_cmdShowVolumes
(){
}
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# VERIFY RETURNCODES
# VERIFY RETURNCODES
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
plugins/transfer/duplicity.sh
+
33
−
0
View file @
c3f14217
...
@@ -190,6 +190,39 @@ export PASSPHRASE
...
@@ -190,6 +190,39 @@ export PASSPHRASE
}
}
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# RESTORE
# --------------------------------------------------------------------------------
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function
t_cmdShowVolumes
(){
tmpoutVolumes
=
/tmp/outvolumelist_
$$
echo
duplicity collection-status
${
sParams
}
${
sTarget
}
color cmd
duplicity collection-status
${
sParams
}
${
sTarget
}
|
tee
-a
$tmpoutVolumes
fetchrc
color reset
echo
if
[
`
cat
$tmpoutVolumes
| egrep
"(Full|Incremental)"
|
wc
-l
`
-eq
0
]
;
then
color error
echo
"ERROR: no backup sets were found for directory [
$sDir2restore
]"
echo
color reset
sDir2restore
=
setVars
else
color ok
echo
"OK,
`
cat
$tmpoutVolumes
|
grep
"Full"
|
wc
-l
`
Full and
`
cat
$tmpoutVolumes
|
grep
"Incremental"
|
wc
-l
`
incremental backups"
color reset
fi
rm
-f
$tmpoutVolumes
}
# --------------------------------------------------------------------------------
# VERIFY RETURNCODES
# VERIFY RETURNCODES
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
plugins/transfer/restic.sh
+
53
−
1
View file @
c3f14217
...
@@ -36,6 +36,10 @@
...
@@ -36,6 +36,10 @@
# WORKAROUND for bug while writing on a SMB target
# WORKAROUND for bug while writing on a SMB target
export
GODEBUG
=
"asyncpreemptoff=1"
export
GODEBUG
=
"asyncpreemptoff=1"
RESTORE_ITEM
=
latest
RESTORE_FILTER
=
RESTORE_CMD
=
}
}
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
...
@@ -196,6 +200,54 @@
...
@@ -196,6 +200,54 @@
echo
"Nothing here."
echo
"Nothing here."
}
}
# --------------------------------------------------------------------------------
# RESTORE
# --------------------------------------------------------------------------------
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function
t_cmdShowVolumes
(){
eval
restic snapshots
${
sParams
}
--path
$sDir2restore
}
# select a snapshot to restore from
function
t_restoreSelect
(){
local
_selid
=
echo
"--- Existing snapshots:"
color cmd
t_cmdShowVolumes
color reset
showPrompt
"ID of the snapshot to restore from [
$RESTORE_ITEM
] >"
read
_selid
test
-z
"
$_selid
"
&&
_selid
=
$RESTORE_ITEM
RESTORE_ITEM
=
$_selid
echo
using
\"
$RESTORE_ITEM
\"
echo
}
# set a filter to reduce count of files to restore
function
t_restoreFilter
(){
local
_inc
=
echo
"--- Filter:"
echo
"By default all files will be restored."
echo
"You can limit it by setting include rules."
echo
"You can enter ..."
echo
" - a single directory name anywhere in the folderstructure"
echo
" - a filename without path"
echo
" - a filemask"
showPrompt
"Include []>"
read
_inc
RESTORE_FILTER
=
"
$_sIncParams
$(
t_getParamInlude
"
$_inc
"
)
"
echo
using parameter
\"
$RESTORE_FILTER
\"
echo
}
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function
t_cmdRestore
(){
echo
"eval restic restore
${
sParams
}
--path
$sDir2restore
--target
${
sRestorepath
}
$RESTORE_FILTER
$RESTORE_ITEM
"
}
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# VERIFY RETURNCODES
# VERIFY RETURNCODES
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
...
@@ -219,7 +271,7 @@
...
@@ -219,7 +271,7 @@
color reset
color reset
}
}
# repoitory cleanup
# repo
s
itory cleanup
function
t_rcCheckCleanup
(){
function
t_rcCheckCleanup
(){
case
$1
in
case
$1
in
0
)
color ok
;
echo
"OK"
;;
0
)
color ok
;
echo
"OK"
;;
...
...
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