aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-28 16:51:50 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-28 16:51:50 -0200
commitda7b027fdef77a6d492dadf1c6b11704836b0cb6 (patch)
treee7f3201da5abb3f4ed99c3621e48faac7cac48ff
parent6a2f2ac676d2cc2a8f7426487f7e5a0837fadd8c (diff)
downloadpuppet-backup-da7b027fdef77a6d492dadf1c6b11704836b0cb6.tar.gz
puppet-backup-da7b027fdef77a6d492dadf1c6b11704836b0cb6.tar.bz2
Rotating created metafiles for daily backups at rsync handler
-rw-r--r--files/handlers/rsync18
1 files changed, 18 insertions, 0 deletions
diff --git a/files/handlers/rsync b/files/handlers/rsync
index a81283f..3d5f22f 100644
--- a/files/handlers/rsync
+++ b/files/handlers/rsync
@@ -416,6 +416,9 @@ function rotate_long {
$nice mv $dir.$i $dir.$next
mkdir -p $metadata.$next
date +%c%n%s > $metadata.$next/rotated
+ if [ -f $metadata.$i/created ]; then
+ $nice mv $metadata.$i/created $metadata.$next
+ fi
else
echo "Debug: skipping rotation of $dir.$i because $dir.$next already exists."
fi
@@ -432,6 +435,9 @@ function rotate_long {
$nice mv $backuproot/daily.$max $backuproot/weekly.1
mkdir -p $backuproot/metadata/weekly.1
date +%c%n%s > $backuproot/metadata/weekly.1/rotated
+ #if [ -f $backuproot/metadata/daily.$max/created ]; then
+ # $nice mv $backuproot/metadata/daily.$max/created $backuproot/metadata/weekly.1/
+ #fi
fi
max=$((keepweekly+1))
@@ -440,6 +446,9 @@ function rotate_long {
$nice mv $backuproot/weekly.$max $backuproot/monthly.1
mkdir -p $backuproot/metadata/monthly.1
date +%c%n%s > $backuproot/metadata/monthly.1/rotated
+ #if [ -f $backuproot/metadata/weekly.$max/created ]; then
+ # $nice mv $backuproot/metadata/weekly.$max/created $backuproot/metadata/weekly.1/
+ #fi
fi
for rottype in daily weekly monthly; do
@@ -517,6 +526,9 @@ function rotate_long_remote {
$nice mv \$dir.\$i \$dir.\$next
mkdir -p \$metadata.\$next
date +%c%n%s > \$metadata.\$next/rotated
+ if [ -f \$metadata.\$i/created ]; then
+ $nice mv \$metadata.\$i/created \$metadata.\$next
+ fi
else
echo "Debug: skipping rotation of \$dir.\$i because \$dir.\$next already exists."
fi
@@ -533,6 +545,9 @@ function rotate_long_remote {
$nice mv $backuproot/daily.\$max $backuproot/weekly.1
mkdir -p $backuproot/metadata/weekly.1
date +%c%n%s > $backuproot/metadata/weekly.1/rotated
+ #if [ -f $backuproot/metadata/daily.\$max/created ]; then
+ # $nice mv $backuproot/metadata/daily.\$max/created $backuproot/metadata/weekly.1/
+ #fi
fi
max=\$((keepweekly+1))
@@ -541,6 +556,9 @@ function rotate_long_remote {
$nice mv $backuproot/weekly.\$max $backuproot/monthly.1
mkdir -p $backuproot/metadata/monthly.1
date +%c%n%s > $backuproot/metadata/monthly.1/rotated
+ #if [ -f $backuproot/metadata/weekly.\$max/created ]; then
+ # $nice mv $backuproot/metadata/weekly.\$max/created $backuproot/metadata/weekly.1/
+ #fi
fi
for rottype in daily weekly monthly; do