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
|
||||
|
||||
* close log before printing failed backups info
|
||||
|
||||
@ -185,10 +185,12 @@ runBackup() {
|
||||
|
||||
if [[ $2 == PROTOCOLMISMATCH ]]
|
||||
then
|
||||
# Protocol mismatch occurred, maybe caused by multiple --link-dest
|
||||
# occurrences with rsync server protocol < 29
|
||||
proto29=1
|
||||
MAX_ROTATE=1
|
||||
fi
|
||||
for (( backup_num=0 ; backup_num <= MAX_ROTATE ; backup_num++ ))
|
||||
for (( backup_num=1 ; backup_num <= MAX_ROTATE ; backup_num++ ))
|
||||
do
|
||||
if [ -d "$SNAPSHOT_RW/$NAME/daily.$backup_num" ]
|
||||
then
|
||||
@ -209,6 +211,14 @@ runBackup() {
|
||||
RSYNC_OPTS="$RSYNC_OPTS --timeout=1800"
|
||||
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++ ))
|
||||
do
|
||||
$RSYNC \
|
||||
@ -226,6 +236,14 @@ runBackup() {
|
||||
break
|
||||
;;
|
||||
*)
|
||||
if (( try == RETRY ))
|
||||
then
|
||||
cat <<-EOF
|
||||
|
||||
Trial $try / $RETRY failed, Giving up!
|
||||
|
||||
EOF
|
||||
else
|
||||
cat <<-EOF
|
||||
|
||||
Trial $try / $RETRY failed.
|
||||
@ -233,6 +251,7 @@ runBackup() {
|
||||
|
||||
EOF
|
||||
sleep $RETRY_DELAY
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@ -266,13 +285,6 @@ runBackup() {
|
||||
unset proto29
|
||||
}
|
||||
|
||||
# make sure we're running as root
|
||||
if [ ! $UID -eq 0 ]
|
||||
then
|
||||
echo "Sorry, must be root. Exiting..."
|
||||
exit
|
||||
fi
|
||||
|
||||
openLog
|
||||
|
||||
if [ -n "$EMERG" ]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user