LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cron (https://www.linuxquestions.org/questions/linux-newbie-8/cron-75231/)

HappyDude 07-23-2003 12:29 PM

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

/usr/bin/ez-ipupdate -c /usr/local/bin/ez-ipupdate.conf

and when I crontab -e it comes out with:
Code:

15,30,45,59 * * * * /root/shell
Does anyone know whats wrong? Please help!

david_ross 07-23-2003 12:53 PM

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

HappyDude 07-23-2003 02:26 PM

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.

shaheen 08-01-2003 10:30 AM

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

HappyDude 08-02-2003 01:24 PM

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 07:44 PM.