aboutsummaryrefslogtreecommitdiff
path: root/files/handlers/rsync
diff options
context:
space:
mode:
Diffstat (limited to 'files/handlers/rsync')
-rw-r--r--files/handlers/rsync10
1 files changed, 7 insertions, 3 deletions
diff --git a/files/handlers/rsync b/files/handlers/rsync
index 2b9da5a..dffcfc5 100644
--- a/files/handlers/rsync
+++ b/files/handlers/rsync
@@ -416,6 +416,7 @@ function rotate_long {
$nice mv $dir.$i $dir.$next
mkdir -p $backuproot/metadata/$rottype.$next
date +%c%n%s > $backuproot/metadata/$rottype.$next/rotated
+ rm -f $backuproot/metadata/$rottype.$next/created
else
echo "Debug: skipping rotation of $dir.$i because $dir.$next already exists."
fi
@@ -517,6 +518,7 @@ function rotate_long_remote {
$nice mv \$dir.\$i \$dir.\$next
mkdir -p $backuproot/metadata/\$rottype.\$next
date +%c%n%s > $backuproot/metadata/\$rottype.\$next/rotated
+ rm -f $backuproot/metadata/\$rottype.\$next/created
else
echo "Debug: skipping rotation of \$dir.\$i because \$dir.\$next already exists."
fi
@@ -528,7 +530,7 @@ function rotate_long_remote {
done
max=\$((keepdaily+1))
- if [ \$keepweekly -gt 0 -a -d $backuproot/daily.\$max -a ! -d \$backuproot/weekly.1 ]; then
+ if [ \$keepweekly -gt 0 -a -d $backuproot/daily.\$max -a ! -d $backuproot/weekly.1 ]; then
echo "Debug: daily.\$max --> weekly.1"
$nice mv $backuproot/daily.\$max $backuproot/weekly.1
mkdir -p $backuproot/metadata/weekly.1
@@ -581,7 +583,8 @@ function setup_long_dirs {
if [ -d $dir.1 ]; then
if [ -f $metadata/created ]; then
- echo "Warning: $dir.1 already exists. Overwriting contents."
+ echo "Warning: $dir.1 already exists, aborting."
+ exit
else
echo "Warning: we seem to be resuming a partially written $dir.1"
fi
@@ -631,7 +634,8 @@ function setup_long_dirs_remote {
if [ -d $dir.1 ]; then
if [ -f $metadata/created ]; then
- echo "Warning: $dir.1 already exists. Overwriting contents."
+ echo "Warning: $dir.1 already exists, aborting."
+ exit
else
echo "Warning: we seem to be resuming a partially written $dir.1"
fi