Results 1 to 5 of 5
I have the following line in crontab:
Code:
0 0,6,12,18 * * * * /usr/home/userid/script.sh > /usr/home/userid/script.log
This script does a curl on a webpage and writes it to disk ...
- 06-20-2008 #1Linux User
- Join Date
- Dec 2004
- Posts
- 323
Need help with setting up crontab in FreeBSD
I have the following line in crontab:
This script does a curl on a webpage and writes it to disk by appending a timestamp to the filename. If I look in the /var/log/cron however, it appears that this cron job has never run. The only way to invoke the script.sh script is manually.Code:0 0,6,12,18 * * * * /usr/home/userid/script.sh > /usr/home/userid/script.log
Is there a reason why this cron job does not run? Could it be a permissioning issue?
- 06-21-2008 #2
Hello
Your syntax looks right for the cron. Here is a quick test you can add to your crontab to see if it is working. First make a dir called test in /home
*/5 * * * * /bin/date >> /home/test/date
if the cron runs this test but not your syntax it is probilly a permissions
problem. Then just add your syntax to the root crontab and run it from there.
Hope this helps you out
- 06-23-2008 #3Linux User
- Join Date
- Dec 2004
- Posts
- 323
Thanks, that worked:
- script.sh does not work from the crontab, only through a manual invoke does it work
- date cron does work as intended.
So that means the permissioning issue remains? What do you mean by "Then just add your syntax to the root crontab and run it from there." ?
Thanks in advance
- 06-23-2008 #4
There is a users crontab and a root user crontab
at the command line type su
password for root , then as root type crontab -e
- 06-23-2008 #5Linux User
- Join Date
- Dec 2004
- Posts
- 323
Thanks again for your response. The crontab is set up for root only and contains both statements:
The file script.sh has rights as follows: -rwxr-xr-xCode:0 0,6,12,18 * * * * /usr/home/userid/script.sh > /usr/home/userid/script.log */5 * * * * /bin/date > /home/test/date
which I think should suffice.
What else could be wrong?


Reply With Quote