]> git.donarmstrong.com Git - bin.git/blobdiff - update_mobile_org
remove convert_to_xls and .sa_bin
[bin.git] / update_mobile_org
index 2de7dc2547fa50efa1315be5a61829dcb8f35569..f154fbd7b702755b345f15f81ac8b7bcea1ccb33 100755 (executable)
@@ -1,12 +1,28 @@
 #!/bin/bash
 
+HOSTNAME=$(hostname)
 TMPDIR=~/tmp
 export TMPDIR
-. ~/.ssh/ssh_agent_info_$(hostname)
+. ~/.ssh/ssh_agent_info_${HOSTNAME}
 LOCKOPTS=-q
+LOCKFILE=$TMPDIR/update_mobile_org
 if [ -n "$PS1" ]; then
     LOCKOPTS=-f;
 fi;
-mr -d ~/org-mode up;
-with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org emacs --batch -l ~/.emacs -f 'org-mobile-push' -f 'org-mobile-pull'
-mr -d ~/org-mode commit -m'org mobile automated commit and push';
+LOCKIT="with-lock-ex $LOCKOPTS $LOCKFILE"
+TIMEOUT="timeout -k1m 1m"
+${LOCKIT} ${TIMEOUT} mr -d ~/org-mode up;
+if [ "$HOSTNAME" = "linnode" ]; then
+    ${LOCKIT} ${TIMEOUT} mr -d ~/projects/org-notes up;
+else
+    ${LOCKIT} ${TIMEOUT} emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1;
+fi;
+yes|${LOCKIT} timeout -k1m 5m emacs --batch -l ~/.emacs \
+                 --eval '(org-mobile-push)' --eval '(org-mobile-pull)' --eval '(org-save-all-org-buffers)';
+
+if [ "$HOSTNAME" = "rzlab" ]; then
+    ${LOCKIT} ${TIMEOUT} \
+                 mr -d ~/projects/org-notes commit -m'org mobile automated commit and push';
+fi;
+${LOCKIT} ${TIMEOUT} \
+          mr -d ~/org-mode commit -m'org mobile automated commit and push';