summaryrefslogtreecommitdiff
path: root/backup.in
diff options
context:
space:
mode:
Diffstat (limited to 'backup.in')
-rwxr-xr-xbackup.in21
1 files changed, 6 insertions, 15 deletions
diff --git a/backup.in b/backup.in
index 012618c..8d9942e 100755
--- a/backup.in
+++ b/backup.in
@@ -1,9 +1,9 @@
#!/bin/bash
-rsyncOptions=( # common to both runs: verbose, stay-on-device, use checksums
- '-vxcrlDH' # only in first run: recurse and preserve soft links, devices, hard links
- '-vxcaHAX' # only in second run: "archive" and preseve hardlinks, ACLs, xattr
-)
+rsyncOptions='-vxcaHAX'
+rsync --may-modify-others 2>&1 | \
+ grep -q 'unknown option' ||
+ rsyncOptions="${rsyncOptions} --may-modify-others"
[ -r "#ETCDIR#/backup.conf" ] && \
. "#ETCDIR#/backup.conf"
@@ -116,28 +116,19 @@ chmod 750 ${neues}
chown erich:root ${neues}
if [ -z "${rsyncShell}" ]
then
- rsync ${rsyncOptions[0]} \
+ rsync ${rsyncOptions} \
${linkdests} \
${excludeArgs} \
${Quelle} ${neues}/
sleep 1
- rsync ${rsyncOptions[1]} \
- ${excludeArgs} \
- ${Quelle} ${neues}/
- sleep 1
rsync ${Quelle}
else
rsync "${rsyncShell}" \
- ${rsyncOptions[0]} \
+ ${rsyncOptions} \
${linkdests} \
${excludeArgs} \
${Quelle} ${neues}/
sleep 1
- rsync "${rsyncShell}" \
- ${rsyncOptions[1]} \
- ${excludeArgs} \
- ${Quelle} ${neues}/
- sleep 1
rsync "${rsyncShell}" ${Quelle}
fi
erg=$?