]> git.donarmstrong.com Git - bin.git/blobdiff - update_mobile_org
Merge branch 'master' of git+ssh://git.donarmstrong.com/srv/git/bin
[bin.git] / update_mobile_org
index 8c249011b7610da464d0c3445c22bf56df3a77cc..f1c98e87f31def9fe221b097278b7f7aa78c543a 100755 (executable)
@@ -3,4 +3,12 @@
 TMPDIR=~/tmp
 export TMPDIR
 . ~/.ssh/ssh_agent_info_$(hostname)
-emacs --batch -l ~/.emacs -f 'org-mobile-push' -f 'org-mobile-pull'
+LOCKOPTS=-q
+if [ -n "$PS1" ]; then
+    LOCKOPTS=-f;
+fi;
+mr -d ~/org-mode up;
+with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org timeout -k1m 1m emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1
+yes|with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org timeout -k1m 5m emacs --batch -l ~/.emacs \
+    --eval '(org-mobile-push)' --eval '(org-mobile-pull)' --eval '(org-save-all-org-buffers)';
+mr -d ~/org-mode commit -m'org mobile automated commit and push';