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
This commit is contained in:
Thomas Hood 2015-12-03 21:29:20 +00:00
parent d956aa1fc6
commit ac4d41115b

View File

@ -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'