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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-23-2003, 12:29 PM
|
#1
|
Member
Registered: Jul 2003
Posts: 140
Rep:
|
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!
|
|
|
07-23-2003, 12:53 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
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
|
|
|
07-23-2003, 02:26 PM
|
#3
|
Member
Registered: Jul 2003
Posts: 140
Original Poster
Rep:
|
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.
|
|
|
08-01-2003, 10:30 AM
|
#4
|
LQ Newbie
Registered: Jul 2003
Location: India
Distribution: Red Hat 7.1
Posts: 27
Rep:
|
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
|
|
|
08-02-2003, 01:24 PM
|
#5
|
Member
Registered: Jul 2003
Posts: 140
Original Poster
Rep:
|
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 02:26 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|