Adding script to schedule the PINES survey
authorChris Sharp <csharp@georgialibraries.org>
Wed, 15 Apr 2015 16:16:16 +0000 (12:16 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 15 Apr 2015 16:16:16 +0000 (12:16 -0400)
pines-survey/schedule-survey.sh [new file with mode: 0755]

diff --git a/pines-survey/schedule-survey.sh b/pines-survey/schedule-survey.sh
new file mode 100755 (executable)
index 0000000..ae963f6
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+Usage () {
+echo "Usage: $0 <YYYY-MM-DD>"
+exit
+}
+
+if [ -z "$1" ]; then
+Usage
+fi
+
+START_DATE="$1"
+END_DATE=$(date --date "$START_DATE + 1 week" +%F)
+
+at midnight $START_DATE <<END
+/home/opensrf/survey-up.sh
+END
+
+at midnight $END_DATE <<END
+/home/opensrf/survey-down.sh
+END
+
+echo "Scheduled jobs: "
+atq