I'm running Ubuntu16.
I'm trying to run very simple bash scripts and cron jobs!
I'm trying to get cron to run the following bash script on a daily basis:
#!/bin/bash
echo "Hello James how is your day going"
I can run the script from the command line no problem, but cron won't? My Cron job is set up as such:
0 15 * * * /tmp/myjob.sh
What am I missing?
What you actually need first of all is this script here:
You can test by running it every minute.
This will give you a popup every minute with how you are doing ;)
First, you should start bash scripts with 'shebang': #!/bin/bash (don't forget the # key). Also give the file execution permission:
Then on cron I would suggest you to put as:
You cron job is set to run every day as 15:00 (3pm). I would suggest you to put it to run every 2 minutes to test first.
Add example to turn off monitor in 2 minutes:
restart cron
No need to create a
.sh
file!