From da7b027fdef77a6d492dadf1c6b11704836b0cb6 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 28 Nov 2010 16:51:50 -0200 Subject: Rotating created metafiles for daily backups at rsync handler --- files/handlers/rsync | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'files') 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 -- cgit v1.2.3