Cron
I'm currently trying to get cron to start a script (I named it shell) every 15 minutes. When I run it manually from the terminal it works fine. But when cron does it it doesn't work. These are my scripts.
/root/shell: Code:
#!/bin/sh Code:
15,30,45,59 * * * * /root/shell |
That does seem odd. I assue you are putting it in the crontab of the same user you are running it as?
I have 2 suggestions - 1) forget the script and make your crontab: 15,30,45,59 * * * * /usr/bin/ez-ipupdate -c /usr/local/bin/ez-ipupdate.conf 2) In either case - create a log file: 15,30,45,59 * * * * /path/to/command 2>&1 > /tmp/mycron.log |
EDIT: Well I tryed your way at voila... It worked! As for the log file Ill figure out how to get that working. Thank You!!!
Ok Ill try that.. Thank you. |
crontab writing
HappyDude i see David has already posted that message and the procedure , anyway one short process to that
15,30,45,59 * * * * /usr/bin/ez-ipupdate -c /usr/local/bin/ez-ipupdate.conf is */15 * * * * /usr/bin/ez-ipupdate -c /usr/local/bin/ez-ipupdate.conf and subsequently so !! That is same , only a shorter writing abt some informal discussion ... the general syntax of writing this : minutes hrs day_of_month month day_of_week which takes inputs in the form (0-59) (0-23) (1-31) (1-12) (0-6) respectively Thus : 0 1 * * 1-5 command (will run every monday-friday at 1 am) 0 1 * * 1,3,5 command (will run every mon,wed,fri at 1 am) 10 2 1 * * command (will run at 2:10 am on the first of every month) 0 1 1 1 * command (will run at 1 am on January 1 every year) Just pure calculation nothing else .. do let me know if it works Best of luck Shaheen |
Well thanks for the help but I sorta already got that part working using davids version so now if I used your version it would be more typing.
|
All times are GMT -5. The time now is 12:15 AM. |