From df84d9e3d1aa4266edd09caea980cf505d288ec6 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 6 May 2015 08:11:12 -0700 Subject: [PATCH] support having the this run on rzlab --- update_mobile_org | 26 ++++++++++++++++++++------ update_org_ical | 16 +++++++++++++--- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/update_mobile_org b/update_mobile_org index f1c98e8..41f898a 100755 --- a/update_mobile_org +++ b/update_mobile_org @@ -1,14 +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 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'; +LOCKIT=with-lock-ex $LOCKOPTS $LOCKFILE +TIMEOUT=timeout -k1m 1m +${LOCKIT} ${TIMEOUT} mr -d ~/org-mode up; +if [ "$HOSTNAME" = "rzlab" ]; 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'; diff --git a/update_org_ical b/update_org_ical index 84b57a7..eadbcd8 100755 --- a/update_org_ical +++ b/update_org_ical @@ -1,13 +1,19 @@ #!/bin/bash +HOSTNAME=$(hostname) TMPDIR=~/tmp export TMPDIR -. ~/.ssh/ssh_agent_info_$(hostname) +. ~/.ssh/ssh_agent_info_${HOSTNAME} LOCKOPTS=-q if [ -n "$PS1" ]; then LOCKOPTS=-f; fi; -with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 1m emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1 + +if [ "$HOSTNAME" = "rzlab" ]; then + with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 1m mr -d ~/projects/org-notes up; +else + with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 1m emacsclient -n -e '(org-save-all-org-buffers)' >/dev/null 2>&1 +fi; yes|with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 3m emacs --batch -l ~/.emacs \ --eval '(setq org-icalendar-combined-description "Don Armstrong’s Calendar (org-mode)")' \ --eval '(setq org-icalendar-combined-name "Don Armstrong (org-mode)")' \ @@ -15,4 +21,8 @@ yes|with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 3m emacs --batch --eval "(setq org-icalendar-exclude-tags '( \"habit\" ) )" \ --eval '(org-icalendar-combine-agenda-files)' \ --eval '(org-save-all-org-buffers)'; -with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 1m rsync -av "$TMPDIR/org.ics" rzlab.ucr.edu:debian/.google_ical*/org.ics +if [ "$HOSTNAME" = "rzlab" ]; then + with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 1m rsync -av "$TMPDIR/org.ics" debian/.google_ical*/org.ics +else + with-lock-ex $LOCKOPTS $TMPDIR/update_org_ical timeout -k1m 1m rsync -av "$TMPDIR/org.ics" rzlab.ucr.edu:debian/.google_ical*/org.ics +fi; -- 2.39.2