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
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
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
Liberate
backupninja
Commits
b29b969b
Commit
b29b969b
authored
20 years ago
by
elijah
Browse files
Options
Downloads
Patches
Plain Diff
added options, keep passed directly to rdiff-backup
parent
c11ba1a2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
etc/backup.d/example.rdiff
+5
-1
5 additions, 1 deletion
etc/backup.d/example.rdiff
handlers/rdiff
+24
-20
24 additions, 20 deletions
handlers/rdiff
with
29 additions
and
21 deletions
etc/backup.d/example.rdiff
+
5
−
1
View file @
b29b969b
## passed directly to rdiff-backup
# options = --force
######################################################
## source section
## (where the files to be backed up are coming from)
...
...
@@ -12,7 +15,8 @@ label = thishostname
type = local
# how many days of data to keep
keep = 185
# (you can also use the time format of rdiff-backup, e.g. 6D5h)
keep = 60
# files to include in the backup
# (supports globbing with '*')
...
...
This diff is collapsed.
Click to expand it.
handlers/rdiff
+
24
−
20
View file @
b29b969b
...
...
@@ -3,11 +3,13 @@
# requires rdiff-backup
#
getconf options
setsection source
getconf type; sourcetype=$type
getconf label
getconf user root; sourceuser=$user
getconf keep
getconf keep
60
getconf include
getconf exclude
...
...
@@ -55,30 +57,32 @@ execstr_clientpart="/"
## REMOVE OLD BACKUPS
if [ "$keep" -gt "0" ]; then
removestr="rdiff-backup --force --remove-older-than ${keep}D "
if [ "$desttype" == "remote" ]; then
removestr="${removestr}${destuser}@${desthost}::"
fi
removestr="${removestr}${destdir}/${label}";
debug "su $sourceuser -c '$removestr'"
if [ ! $test ]; then
output=`su $sourceuser -c "$removestr" 2>&1`
code=$?
if [ "$code" == "0" ]; then
debug $output
info "Removing backups older than $keep days succeeded."
else
warning $output
warning "Failed removing backups older than $keep."
fi
if [ "`echo $keep | tr -d 0-9`" == "" ]; then
keep="${keep}D"
fi
removestr="rdiff-backup --force --remove-older-than $keep "
if [ "$desttype" == "remote" ]; then
removestr="${removestr}${destuser}@${desthost}::"
fi
removestr="${removestr}${destdir}/${label}";
debug "su $sourceuser -c '$removestr'"
if [ ! $test ]; then
output=`su $sourceuser -c "$removestr" 2>&1`
code=$?
if [ "$code" == "0" ]; then
debug $output
info "Removing backups older than $keep days succeeded."
else
warning $output
warning "Failed removing backups older than $keep."
fi
fi
## EXECUTE ##
execstr="$RDIFFBACKUP --print-statistics "
execstr="$RDIFFBACKUP
$options
--print-statistics "
# TODO: order the includes and excludes
...
...
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