]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Adding --dropunused to sync-media
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 18 Feb 2013 19:19:36 +0000 (16:19 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 18 Feb 2013 19:19:36 +0000 (16:19 -0300)
files/sync-media

index 251ca0a76431924e4df2cae284d47c7d5c7c69f0..dc93bd9e7b63752b90c07580a69e97e0a48f2fac 100644 (file)
@@ -49,6 +49,11 @@ if echo $OPTIONS | grep -q -- "--fsck"; then
   FSCK="true"
 fi
 
+# Set unused config
+if echo $OPTIONS | grep -q -- "--dropunused"; then
+  DROPUNUSED="true"
+fi
+
 # Commit changes
 if [ -d "$CACHE" ]; then
   # Fix cache permissions
@@ -77,8 +82,10 @@ if [ -d "$CACHE" ]; then
         git annex fsck --fast
       fi
 
-      git annex unused
-      git annex dropunused 1-1000
+      if [ "$DROPUNUSED" == "true" ]; then
+        git annex unused
+        git annex dropunused 1-1000
+      fi
       )
     fi
   done
@@ -126,8 +133,11 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then
         git annex fsck --fast
       fi
 
-      #git annex unused
-      #git annex dropunused 1-1000
+      if [ "$DROPUNUSED" == "true" ]; then
+        git annex unused
+        git annex dropunused 1-1000
+      fi
+
       #git annex drop --auto --numcopies=2
       )
     fi