]> git.donarmstrong.com Git - bin.git/blob - update_mobile_org
use timeout
[bin.git] / update_mobile_org
1 #!/bin/bash
2
3 TMPDIR=~/tmp
4 export TMPDIR
5 . ~/.ssh/ssh_agent_info_$(hostname)
6 LOCKOPTS=-q
7 if [ -n "$PS1" ]; then
8     LOCKOPTS=-f;
9 fi;
10 mr -d ~/org-mode up;
11 with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org timeout -k1m 1m emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1
12 yes|with-lock-ex $LOCKOPTS $TMPDIR/update_mobile_org timeout -k1m 5m emacs --batch -l ~/.emacs \
13     --eval '(org-mobile-push)' --eval '(org-mobile-pull)' --eval '(org-save-all-org-buffers)';
14 mr -d ~/org-mode commit -m'org mobile automated commit and push';