diff options
Diffstat (limited to 'backup.in')
-rwxr-xr-x | backup.in | 21 |
1 files changed, 6 insertions, 15 deletions
@@ -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=$? |