What is Wrong with my CRON?
With the better advice of members on this board, ive been playing with cron a bit for automation. However, I cant seem to get cron to run my custom scripts.
For example Ill try the following: # crontab 11 14 12 9 * /root/school/at/crontest cnrtl D the only line in this script is: date >> curdate curdate exists in the at directory so i expected this to run at 2:11 today, but it didnt. now if i do something like # crontab 11 14 12 9 * date >> /root/school/at/curdate cnrtl D that will work, but why not my script? ive run the script on my own and it works fine, just not with cron? |
1) Add this as the first line of your script:
#!/bin/sh Your terminal might understand how to interpret your script, but crond can't, so the system will have to depend on this line to know how to execute it. 2) I recently learned a good lesson (:rolleyes:) on paths. System applications will probably always work, but in other cases it might be a fine idea to specify the entire path which you'd get when using "whereis application". |
tried adding #!/bin/sh, which i should get in the habit of, but still didnt work. any other ideas?
|
Try using * * * * * to make the cronjob run every minute.. Maybe you just got the date wrong or something like that :)
|
All times are GMT -5. The time now is 01:32 PM. |