diff options
-rwxr-xr-x | files/sync-media | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/files/sync-media b/files/sync-media index f80f1e8..37bc6c2 100755 --- a/files/sync-media +++ b/files/sync-media @@ -9,12 +9,18 @@ DOMAIN="`facter domain`" MEDIA="media.$DOMAIN" INCOMING="$CACHE/incoming" WHOAMI="`whoami`" +OPTIONS="$*" # Set sudo config if [ "$WHOAMI" != 'root' ]; then sudo="sudo" fi +# Set fsck config +if echo $OPTIONS | grep -q "--fsck"; then + FSCK="true" +fi + # Commit changes if [ -d "$CACHE" ]; then # Fix cache permissions @@ -61,7 +67,11 @@ if [ -d "$CACHE" ]; then done git annex sync - git annex fsck --fast + + if [ "$FSCK" == "true" ]; then + git annex fsck --fast + fi + git annex unused git annex dropunused 1-1000 ) @@ -103,7 +113,11 @@ if [ -d "$VOLUME/$MEDIA" ]; then echo "Syncing $VOLUME/$MEDIA/$folder..." git annex sync git annex get --auto --numcopies=3 - git annex fsck --fast + + if [ "$FSCK" == "true" ]; then + git annex fsck --fast + fi + git annex unused git annex dropunused 1-1000 #git annex drop --auto --numcopies=2 |