diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-12-12 16:49:23 -0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2012-01-01 10:46:15 +0100 |
commit | 6933a8724d792147d774a91d08ddf3cdee163e1f (patch) | |
tree | fc6220757a6fb2751eaf742f08c8f7a03eecaa54 /handlers | |
parent | aaa53a78b2757ce0e8d4b18cf96f4d45c2c3ec90 (diff) | |
download | backupninja-6933a8724d792147d774a91d08ddf3cdee163e1f.tar.gz backupninja-6933a8724d792147d774a91d08ddf3cdee163e1f.tar.bz2 |
Fixing metadata rotation
Diffstat (limited to 'handlers')
-rw-r--r-- | handlers/rsync.in | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/handlers/rsync.in b/handlers/rsync.in index 767b6e0..ab73051 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -413,6 +413,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 @@ -429,6 +432,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)) @@ -437,6 +443,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 @@ -514,6 +523,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 @@ -530,6 +542,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)) @@ -538,6 +553,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 |