Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
raT
backupninja
Commits
830a0075
Commit
830a0075
authored
7 years ago
by
Jérôme Charaoui
Browse files
Options
Downloads
Patches
Plain Diff
[borg] add 'prune' setting to allow disabling pruning
parent
60601b2f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
handlers/borg.helper.in
+24
-16
24 additions, 16 deletions
handlers/borg.helper.in
handlers/borg.in
+2
-1
2 additions, 1 deletion
handlers/borg.in
with
26 additions
and
17 deletions
handlers/borg.helper.in
+
24
−
16
View file @
830a0075
...
@@ -259,8 +259,14 @@ do_borg_con() {
...
@@ -259,8 +259,14 @@ do_borg_con() {
}
}
do_borg_prune
()
{
do_borg_prune
()
{
declare
-a
tmp_array
radioBox
"
$borg_title
"
"pruning (how many backups to keep"
\
"yes"
"regularly prune old backups"
on
\
"no"
"keep all backups"
off
[
$?
=
1
]
&&
return
;
borg_prune
=
"
$REPLY
"
if
[
"
$borg_prune
"
=
"yes"
]
;
then
declare
-a
tmp_array
set
-o
noglob
set
-o
noglob
REPLY
=
REPLY
=
formBegin
"
$borg_title
- pruning (how many backups to keep)"
formBegin
"
$borg_title
- pruning (how many backups to keep)"
...
@@ -278,6 +284,7 @@ do_borg_prune() {
...
@@ -278,6 +284,7 @@ do_borg_prune() {
borg_keepmonthly
=
${
tmp_array
[3]
}
borg_keepmonthly
=
${
tmp_array
[3]
}
set
+o noglob
set
+o noglob
fi
_prune_done
=
"(DONE)"
_prune_done
=
"(DONE)"
}
}
...
@@ -307,6 +314,7 @@ EOF
...
@@ -307,6 +314,7 @@ EOF
cat
>>
$next_filename
<<
EOF
cat
>>
$next_filename
<<
EOF
## for more info see : borg prune -h
## for more info see : borg prune -h
prune =
$borg_prune
keephourly =
$borg_keephourly
keephourly =
$borg_keephourly
keepdaily =
$borg_keepdaily
keepdaily =
$borg_keepdaily
keepweekly =
$borg_keepweekly
keepweekly =
$borg_keepweekly
...
...
This diff is collapsed.
Click to expand it.
handlers/borg.in
+
2
−
1
View file @
830a0075
...
@@ -22,6 +22,7 @@ getconf testconnect yes
...
@@ -22,6 +22,7 @@ getconf testconnect yes
getconf nicelevel 0
getconf nicelevel 0
setsection
source
setsection
source
getconf prune
yes
getconf keephourly 1
getconf keephourly 1
getconf keepdaily 7
getconf keepdaily 7
getconf keepweekly 4
getconf keepweekly 4
...
@@ -138,7 +139,7 @@ fi
...
@@ -138,7 +139,7 @@ fi
prunestr
=
"borg prune --keep-hourly
$keephourly
--keep-daily
$keepdaily
--keep-weekly
$keepweekly
--keep-monthly
$keepmonthly
$execstr_repository
"
prunestr
=
"borg prune --keep-hourly
$keephourly
--keep-daily
$keepdaily
--keep-weekly
$keepweekly
--keep-monthly
$keepmonthly
$execstr_repository
"
debug
"
$prunestr
"
debug
"
$prunestr
"
if
[
$test
=
0
]
;
then
if
[
$test
=
0
]
&&
[
"
$prune
"
==
"yes"
]
;
then
output
=
"
`
su
-c
"
$prunestr
"
2>&1
`
"
output
=
"
`
su
-c
"
$prunestr
"
2>&1
`
"
if
[
$?
=
0
]
;
then
if
[
$?
=
0
]
;
then
debug
$output
debug
$output
...
...
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