aboutsummaryrefslogtreecommitdiff
path: root/bin/sync
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sync')
-rwxr-xr-xbin/sync20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/sync b/bin/sync
new file mode 100755
index 00000000000..be521eed9c2
--- /dev/null
+++ b/bin/sync
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Arquivo automatic syncronizer.
+#
+
+# Parameters
+CWD="`/bin/pwd`"
+GIT="/usr/bin/git"
+NICE="/usr/bin/nice -n 19"
+IONICE="/user/bin/ionice -c 3"
+ARCHIVE="/var/cache/media/arquivo"
+
+# Run
+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