diff options
author | Erich Eckner <git@eckner.net> | 2016-12-13 13:47:49 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-01-05 21:57:13 +0100 |
commit | c62830765874afc763db38ac01e8be9f3ca092e7 (patch) | |
tree | 3b979115765ed3cfacc9179db385a1ba45235796 | |
parent | f03618e74e05e5cb7a2b355a40b4175ba85d3ed1 (diff) | |
download | hardlinkedBackups-c62830765874afc763db38ac01e8be9f3ca092e7.tar.xz |
backup protects files better during transfer
-rwxr-xr-x | backup.in | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -108,18 +108,18 @@ do excludeArgs="${excludeArgs} --exclude ${toExclude}" done -if [ ! -e ${neues} ] +if [ ! -e ${neues}/wip ] then - mkdir ${neues} + mkdir -p ${neues}/wip fi -chmod 750 ${neues} -chown root:root ${neues} +chmod 750 ${neues}{,/wip} +chown root:root ${neues}{,/wip} if [ -z "${rsyncShell}" ] then rsync ${rsyncOptions} \ ${linkdests} \ ${excludeArgs} \ - ${Quelle} ${neues}/ + ${Quelle} ${neues}/wip/ sleep 1 rsync ${Quelle} else @@ -127,7 +127,7 @@ else ${rsyncOptions} \ ${linkdests} \ ${excludeArgs} \ - ${Quelle} ${neues}/ + ${Quelle} ${neues}/wip/ sleep 1 rsync "${rsyncShell}" ${Quelle} fi @@ -137,7 +137,8 @@ erg=$? if [ ${erg} -eq 0 ] || [ ${erg} -eq 24 ] then - mv ${neues} ${neues_Datum} + mv ${neues}/wip ${neues_Datum} + rmdir ${neues} rm ${pidFile} else rm ${pidFile} |