]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Handler fixes (2)
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 17 Aug 2010 02:20:10 +0000 (23:20 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 17 Aug 2010 02:20:10 +0000 (23:20 -0300)
files/handlers/rsync

index d9973a08759b3cb25e1a11ae85b6defd01e45c54..ab0b2ed920e313192c5f97ec8e36ad02405d5c85 100644 (file)
@@ -412,7 +412,7 @@ function rotate_long {
     fi
     
     # Rotate the current list of backups, if we can.
-    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | sed 's/^.*\.//' | sort -n | tail -1`
+    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | sed -e 's/^.*\.//' | sort -n | tail -1`
     [ "$oldest" == "" ] && oldest=0
     for (( i=$oldest; i > 0; i-- )); do
       if [ -d $dir.$i ]; then
@@ -460,7 +460,7 @@ function rotate_long {
   for rottype in daily weekly monthly; do
     max=$((keep${rottype}+1))
     dir="$backuproot/$rottype"
-    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | sed 's/^.*\.//' | sort -n | tail -1`
+    oldest=`find $backuproot -maxdepth 1 -type d -name $rottype'.*' | sed -e 's/^.*\.//' | sort -n | tail -1`
     [ "$oldest" == "" ] && oldest=0 
     # if we've rotated the last backup off the stack, remove it.
     for (( i=$oldest; i >= $max; i-- )); do
@@ -513,7 +513,7 @@ function rotate_long_remote {
     fi
     
     # Rotate the current list of backups, if we can.
-    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | sed 's/^.*\.//' | sort -n | tail -1\`
+    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | sed -e 's/^.*\.//' | sort -n | tail -1\`
     [ "\$oldest" == "" ] && oldest=0
     for (( i=\$oldest; i > 0; i-- )); do
       if [ -d \$dir.\$i ]; then
@@ -561,7 +561,7 @@ function rotate_long_remote {
   for rottype in daily weekly monthly; do
     max=\$((keep\${rottype}+1))
     dir="$backuproot/\$rottype"
-    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | sed 's/^.*\.//' | sort -n | tail -1\`
+    oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | sed -e 's/^.*\.//' | sort -n | tail -1\`
     [ "\$oldest" == "" ] && oldest=0 
     # if we've rotated the last backup off the stack, remove it.
     for (( i=\$oldest; i >= \$max; i-- )); do