LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-23-2003, 12:29 PM   #1
HappyDude
Member
 
Registered: Jul 2003
Posts: 140

Rep: Reputation: 15
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!
 
Old 07-23-2003, 12:53 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 68
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
 
Old 07-23-2003, 02:26 PM   #3
HappyDude
Member
 
Registered: Jul 2003
Posts: 140

Original Poster
Rep: Reputation: 15
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.

Last edited by HappyDude; 07-23-2003 at 02:40 PM.
 
Old 08-01-2003, 10:30 AM   #4
shaheen
LQ Newbie
 
Registered: Jul 2003
Location: India
Distribution: Red Hat 7.1
Posts: 27

Rep: Reputation: 15
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
 
Old 08-02-2003, 01:24 PM   #5
HappyDude
Member
 
Registered: Jul 2003
Posts: 140

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron.allow and cron.deny in slackware? tl64 Slackware 5 10-13-2005 09:44 PM
No More Cron Mail, Cron Error? Xhost Linux - General 3 07-26-2004 04:28 PM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration