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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
1. With varying end-of-month days you might get only 1 day between runs sometimes... /2 means every two days, so if the range is 1-31, that would be 1,3,5 ... 31 and then the job would run again on the first of the next month, only one day later.
2. I don't know if the "/" syntax is respected by all implementations of cron however. Check the crontab manual page in section 5 of the manual, i.e. to find out, do command:
man 5 crontab
Last edited by matthewg42; 10-09-2007 at 09:15 AM.
I'm not sure if /2 stepping on month day will end up with runs on 2, 4, 6 ... or 1, 3, 5 ...
The manual page is a little ambiguous about this. From the manual page it is clear that a range of 0-n/2 will result in even numbers 0, 2, 4, ... n; and for a range 1-n/2 there will be runs at 1,3,5 ... n.
What the * means is not well defined. For minutes in an hour it does state that */2 will start at 0, but there is never a day 0 of the month, so maybe */2 would mean 1,3,5... in that case. Only an experiment or examination of the source will tell. It may even vary according to which cron implementation is being used.
If someone knows for sure, either by looking at the source, or by an experiment, please post. If you do, please also post the cron implementation and version.
I use the default cron which comes with Ubuntu 7.04, and that is anacron 2.3. With this version using a day-of-month vale of */2 ran today - an odd-numbered day.
Perhaps to avoid this ambiguity, you should use "1-31/2" instead of "*/2".
Last edited by matthewg42; 10-09-2007 at 09:51 AM.