From 742efcf6642962f6a76a667f563a4bb6a55db7a2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 18 Feb 2013 16:19:36 -0300 Subject: Adding --dropunused to sync-media --- files/sync-media | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'files') diff --git a/files/sync-media b/files/sync-media index 251ca0a..dc93bd9 100644 --- a/files/sync-media +++ b/files/sync-media @@ -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 -- cgit v1.2.3