dont force root privileges
This commit is contained in:
parent
a76bc6bc98
commit
1ed3a5ee9a
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
|||||||
|
remote-backup (1.5.3) stable; urgency=low
|
||||||
|
|
||||||
|
* Use rsync --fake-super when running as user
|
||||||
|
|
||||||
|
-- Vincent Riquer <v.riquer@b2f-concept.com> Wed, 15 Feb 2012 09:15:16 +0100
|
||||||
|
|
||||||
remote-backup (1.5.2) stable; urgency=low
|
remote-backup (1.5.2) stable; urgency=low
|
||||||
|
|
||||||
* close log before printing failed backups info
|
* close log before printing failed backups info
|
||||||
|
|||||||
@ -185,10 +185,12 @@ runBackup() {
|
|||||||
|
|
||||||
if [[ $2 == PROTOCOLMISMATCH ]]
|
if [[ $2 == PROTOCOLMISMATCH ]]
|
||||||
then
|
then
|
||||||
|
# Protocol mismatch occurred, maybe caused by multiple --link-dest
|
||||||
|
# occurrences with rsync server protocol < 29
|
||||||
proto29=1
|
proto29=1
|
||||||
MAX_ROTATE=1
|
MAX_ROTATE=1
|
||||||
fi
|
fi
|
||||||
for (( backup_num=0 ; backup_num <= MAX_ROTATE ; backup_num++ ))
|
for (( backup_num=1 ; backup_num <= MAX_ROTATE ; backup_num++ ))
|
||||||
do
|
do
|
||||||
if [ -d "$SNAPSHOT_RW/$NAME/daily.$backup_num" ]
|
if [ -d "$SNAPSHOT_RW/$NAME/daily.$backup_num" ]
|
||||||
then
|
then
|
||||||
@ -209,6 +211,14 @@ runBackup() {
|
|||||||
RSYNC_OPTS="$RSYNC_OPTS --timeout=1800"
|
RSYNC_OPTS="$RSYNC_OPTS --timeout=1800"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Not root? use --fake-super
|
||||||
|
if (( UID > 0 ))
|
||||||
|
then
|
||||||
|
echo "(info) running as user, using --fake-super."
|
||||||
|
RSYNC_OPTS="$RSYNC_OPTS --fake-super"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
for (( try=1 ; try <= RETRY ; try++ ))
|
for (( try=1 ; try <= RETRY ; try++ ))
|
||||||
do
|
do
|
||||||
$RSYNC \
|
$RSYNC \
|
||||||
@ -226,13 +236,22 @@ runBackup() {
|
|||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cat <<-EOF
|
if (( try == RETRY ))
|
||||||
|
then
|
||||||
Trial $try / $RETRY failed.
|
cat <<-EOF
|
||||||
Sleeping $RETRY_DELAY...
|
|
||||||
|
|
||||||
EOF
|
Trial $try / $RETRY failed, Giving up!
|
||||||
sleep $RETRY_DELAY
|
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat <<-EOF
|
||||||
|
|
||||||
|
Trial $try / $RETRY failed.
|
||||||
|
Sleeping $RETRY_DELAY...
|
||||||
|
|
||||||
|
EOF
|
||||||
|
sleep $RETRY_DELAY
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -266,13 +285,6 @@ runBackup() {
|
|||||||
unset proto29
|
unset proto29
|
||||||
}
|
}
|
||||||
|
|
||||||
# make sure we're running as root
|
|
||||||
if [ ! $UID -eq 0 ]
|
|
||||||
then
|
|
||||||
echo "Sorry, must be root. Exiting..."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
openLog
|
openLog
|
||||||
|
|
||||||
if [ -n "$EMERG" ]
|
if [ -n "$EMERG" ]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user