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
95ea71bf
Commit
95ea71bf
authored
18 years ago
by
micah
Browse files
Options
Downloads
Patches
Plain Diff
Added rub handler fixes from rhatto
parent
0f46b775
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+4
-2
4 additions, 2 deletions
ChangeLog
handlers/rub
+18
-21
18 additions, 21 deletions
handlers/rub
with
22 additions
and
23 deletions
ChangeLog
+
4
−
2
View file @
95ea71bf
...
...
@@ -7,11 +7,13 @@ version 0.9.5 -- unreleased
sys:
. Fixed typo breaking things for VServers.
. Fix bug when vrootdir is on its own partition (Closes: #395928)
rub
. Fixed typo in rub handler that caused it to not work
. Better sfdisk error and output handling: should now properly warn
when it does not manage to backup a partition table, and shut up when
it succeeds (Closes: #396632)
rub
. Fixed typo in rub handler that caused it to not work
. Changed to use lib/vserver code
. Fixed fsck error
pgsql:
. Support configuring PGSQLUSER for real, and document it a bit; this
broken support actually prevented pgsql handler to work for VServers
...
...
This diff is collapsed.
Click to expand it.
handlers/rub
+
18
−
21
View file @
95ea71bf
...
...
@@ -13,7 +13,7 @@
# [general]
# log = rsync log file
# partition = partition where the backup lives
# fsck = set to 1 if fsck should run on $partition after the backup is made
# fsc
hec
k = set to 1 if fsck should run on $partition after the backup is made
# read_only = set to 1 if $partition is mounted read-only
# mountpoint = backup partition mountpoint or backup main folder
# backupdir = folder relative do $mountpoint where the backup should be stored
...
...
@@ -40,7 +40,7 @@
# initscripts = absolute path where scripts are located
# service = script name to be stoped at the begining of the backup and started at its end
#
# You can also specify some system comands:
# You can also specify some system comands
if you don't want the default system values
:
#
# [system]
# rm = rm command
...
...
@@ -65,7 +65,7 @@ getconf fsck fsck
setsection general
getconf log /var/log/backupninja-rub.log
getconf partition
getconf fsck
getconf fsc
hec
k
getconf read_only
getconf mountpoint
getconf backupdir
...
...
@@ -100,31 +100,29 @@ getconf service
function rotate {
# TODO: force to an absolute path
if [[ "$2" < 4 ]]; then
error "Rotate: minimum of 4 rotations"
exit 1
fi
if [ -d $1.$2 ]; then
$nice $mv $1.$2 $1.tmp
$nice $mv
/
$1.$2
/
$1.tmp
fi
for ((n=`echo "$2 - 1" | bc`; n >= 0; n--)); do
if [ -d $1.$n ]; then
dest=`echo "$n + 1" | bc`
$nice $mv $1.$n $1.$dest
$touch $1.$dest
$nice $mv
/
$1.$n
/
$1.$dest
$touch
/
$1.$dest
fi
done
if [ -d $1.tmp ]; then
$nice $mv $1.tmp $1.0
$nice $mv
/
$1.tmp
/
$1.0
fi
if [ -d $1.1 ]; then
$nice $cp -alf $1.1/. $1.0
$nice $cp -alf
/
$1.1/.
/
$1.0
fi
}
...
...
@@ -257,18 +255,17 @@ if [ "$vservers_are_available" == "yes" ]; then
mkdir -p $backupdir/$VROOTDIR
chmod 000 $backupdir/$VROOTDIR
for candidate in `ls $VROOTDIR`; do
for candidate in $found_vservers; do
candidate="`basename $candidate`"
found_excluded_vserver="0"
if [ "$candidate" != "lost+found" ]; then
for excluded_vserver in $exclude_vserver; do
if [ "$excluded_vserver" == "$candidate" ]; then
found_excluded_vserver="1"
break
fi
done
if [ "$found_excluded_vserver" == "0" ]; then
include="$include $VROOTDIR/$candidate"
for excluded_vserver in $exclude_vserver; do
if [ "$excluded_vserver" == "$candidate" ]; then
found_excluded_vserver="1"
break
fi
done
if [ "$found_excluded_vserver" == "0" ]; then
include="$include $VROOTDIR/$candidate"
fi
done
fi
...
...
@@ -322,7 +319,7 @@ fi
# check partition for errors
if [ "$fsck" == "1" ] || [ "$fsck" == "yes" ]; then
if [ "$fsc
hec
k" == "1" ] || [ "$fsc
hec
k" == "yes" ]; then
umount $mountpoint
if (($?)); then
warning "Could not umount $mountpoint to run fsck"
...
...
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