aboutsummaryrefslogtreecommitdiff
path: root/files/sync-media
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-12-31 16:13:07 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-12-31 16:13:07 -0200
commit15746c59df994f331aacab49b981ee04b217754f (patch)
tree414b6783bfadfca6855c862b14685bee51d3391d /files/sync-media
parentbaf30b586919d52da095e9224f5dbe35b619377a (diff)
downloadpuppet-backup-15746c59df994f331aacab49b981ee04b217754f.tar.gz
puppet-backup-15746c59df994f331aacab49b981ee04b217754f.tar.bz2
Adding --fsck option to sync-media
Diffstat (limited to 'files/sync-media')
-rwxr-xr-xfiles/sync-media18
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