From ac4d41115bb61640e18eb1ace6a84c7bebc83377 Mon Sep 17 00:00:00 2001 From: Thomas Hood Date: Thu, 3 Dec 2015 21:29:20 +0000 Subject: [PATCH] Update Cron Job so as to run only on weekdays 2.0 Should work I believe as long as hangover.sh is in the users home directory --- hangover.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hangover.sh b/hangover.sh index 800a182..a9a06ae 100755 --- a/hangover.sh +++ b/hangover.sh @@ -5,6 +5,18 @@ if who | grep -wq $USER; then exit fi +# Get user home path and username +PATH=~ + +# sets hangover.sh write permission +chmod +x ~/hangover.sh + +# Checks to see if job is in crontab already and if not updates cronto run the script only on weekdays @ 8:45am +if ! crontab -u $USER -l | grep hangover.sh then + echo "45 8 * * 1-5 $PATH/hangover.sh" >> newcronjob + crontab -e newcronjob +fi + # Phone numbers MY_NUMBER='+xxx' NUMBER_OF_BOSS='+xxx'