Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
but could not get the */30 * * * to work that gave me an error:
Quote:
Cron also supports 'step' values.
A value of */2 in the dom field would mean the command runs every two days
and likewise, */5 in the hours field would mean the command runs every
5 hours.
e.g.
* 12 10-16/2 * * root backup.sh
is the same as:
* 12 10,12,14,16 * * root backup.sh
*/15 9-17 * * * root connection.test
Will run connection.test every 15 mins between the hours or 9am and 5pm
i was trying to get something like the last line example there to run.
That's the correct time setup. I don't know about your command though. I don't seem to have a command called svc on FC3 . Normally, to restart a service I use the command like this...
service smb restart. You do want to use the full path in a cron job so that would look like this..
*/30 * * * * /sbin/service smb restart ## example
why is it that cron is telling me that svc -t does not exsist, yet as you can seei can type it in exactly as i have it in my cron job and it works flawlessly.
turned out that crontab -e is the user cron job and does not have the same PATH$ as the user does. in my case root.
i had to call someone on my LUG to get help, but the bottom line was he created a sh script that told the cron job were to find the svc -t /service/imapssl and to run that.
after he did that cron liked what it was told as it now had the information for the PATH$ thanks to the script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.