aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorArquivo Archive <arquivo@localhost>2016-11-27 13:16:20 -0200
committerArquivo Archive <arquivo@localhost>2016-11-27 13:16:20 -0200
commitdd2e6cfed90ba3b240aefc050dd3b1f1603b0796 (patch)
tree3fe230771f675fd5b69652b94852cf58dfef3181 /bin
parent4dab3a2087ae1a032ad1b3ae39efb00c6dcf1973 (diff)
downloadarquivo-dd2e6cfed90ba3b240aefc050dd3b1f1603b0796.tar.gz
arquivo-dd2e6cfed90ba3b240aefc050dd3b1f1603b0796.tar.bz2
Sync script: check for git annex
Diffstat (limited to 'bin')
-rwxr-xr-xbin/sync14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/sync b/bin/sync
index d192d9bef6d..be521eed9c2 100755
--- a/bin/sync
+++ b/bin/sync
@@ -8,11 +8,13 @@ CWD="`/bin/pwd`"
GIT="/usr/bin/git"
NICE="/usr/bin/nice -n 19"
IONICE="/user/bin/ionice -c 3"
-ARCHIVE="/var/cache/sites/arquivo"
+ARCHIVE="/var/cache/media/arquivo"
# Run
-cd $ARCHIVE
-$IONICE $NICE $GIT annex add . && \
-$IONICE $NICE $GIT annex sync && \
-$IONICE $NICE $GIT annex get . &> /dev/null
-cd $CWD
+if [ -d "$ARCHIVE/.git/annex" ]; then
+ cd $ARCHIVE
+ $IONICE $NICE $GIT annex add . && \
+ $IONICE $NICE $GIT annex sync && \
+ $IONICE $NICE $GIT annex get . &> /dev/null
+ cd $CWD
+fi