cron.hourly not working
hey
iam trying to use cron.hourly i made a script pl.sh #!bash echo "aaaa"|mail -s "mail" abc@gmail.com now i have made this file under /etc/cron.hourly and my hourly timer is set in the crontab file */5 * * * * root cd / && run-parts --report /etc/cron.hourly after doing all this i did sudo service cron stop sudo service cron start but its not working what could be the reason of cron.hourly not working |
Try testing your script directly from the command line.
I think it should start out #!/bin/bash You should not have to start and stop cron to make this work. Verify that the script works from the command line before trying to run it from cron. Once you know the script works, use crontab -e from a terminal to edit your cron settings and point the command to the location of the script. For example, if it's called foo.sh and is in /home/[username]/scripts/, point cron at /home/[username]/scripts/foo.sh. Make sure the executable bit is turned on. Crontab -e is the recommended way for editing your crontab. Here's a good reference on cron: http://www.linuxhelp.net/guides/cron/ |
isn't this a duplicate post? I just answered it, and from the same user
|
Quote:
http://www.linuxquestions.org/questi...orking-877102/ |
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
|
All times are GMT -5. The time now is 01:51 PM. |