]> git.donarmstrong.com Git - bin.git/commitdiff
support having the this run on rzlab
authorDon Armstrong <don@donarmstrong.com>
Wed, 6 May 2015 15:11:12 +0000 (08:11 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 6 May 2015 15:11:12 +0000 (08:11 -0700)
update_mobile_org
update_org_ical

index f1c98e87f31def9fe221b097278b7f7aa78c543a..41f898af4a352aa3f53c3ae3e0d8c796c083b6c3 100755 (executable)
@@ -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';
index 84b57a79ec22100387a7b15d851919c50ad56399..eadbcd898139eaef491e620ab8a00e33e52d5af7 100755 (executable)
@@ -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;