install-eg.sh: optionally install default crontab
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 1 Mar 2016 23:08:05 +0000 (15:08 -0800)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 1 Mar 2016 23:08:05 +0000 (15:08 -0800)
deployment/install-eg.sh

index d51a2f6..54e029e 100755 (executable)
@@ -26,6 +26,7 @@ while getopts ":p" opt ; do
   case $opt in
     p ) PROD="prod";;
     e ) EDI="edi";;
   case $opt in
     p ) PROD="prod";;
     e ) EDI="edi";;
+    c ) CRONTAB="crontab";;
   esac
 done
 shift $(($OPTIND - 1))
   esac
 done
 shift $(($OPTIND - 1))
@@ -100,6 +101,13 @@ if [[ ! -n "$PROD" ]] ; then
   a2ensite 499-star.catalogue.libraries.coop.conf
 fi
 
   a2ensite 499-star.catalogue.libraries.coop.conf
 fi
 
+# install default crontab, if specified
+if [[ -c "$CRONTAB" ]]; then
+  if [ ! -f "/etc/cron.d/evergreen-dailies" ] ; then
+    cp ${SITKACONF}/files/etc/cron.d/evergreen-dailies/${HOSTNAME} /etc/cron.d/evergreen-dailies
+  fi
+fi
+
 # set up log rotation
 if [[ ! -n "$PROD" ]] ; then
   if [ ! -f "/etc/logrotate.d/evergreen" ]
 # set up log rotation
 if [[ ! -n "$PROD" ]] ; then
   if [ ! -f "/etc/logrotate.d/evergreen" ]