summaryrefslogtreecommitdiff
path: root/backup.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-12-13 13:47:49 +0100
committerErich Eckner <git@eckner.net>2017-01-05 21:57:13 +0100
commitc62830765874afc763db38ac01e8be9f3ca092e7 (patch)
tree3b979115765ed3cfacc9179db385a1ba45235796 /backup.in
parentf03618e74e05e5cb7a2b355a40b4175ba85d3ed1 (diff)
downloadhardlinkedBackups-c62830765874afc763db38ac01e8be9f3ca092e7.tar.xz
backup protects files better during transfer
Diffstat (limited to 'backup.in')
-rwxr-xr-xbackup.in15
1 files changed, 8 insertions, 7 deletions
diff --git a/backup.in b/backup.in
index 3264370..73ee711 100755
--- a/backup.in
+++ b/backup.in
@@ -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}