Linux - NewbieThis 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.
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.
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.
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 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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.