Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In Linux, Jobs in /etc/crontab daily, weekly and monthly scripts are run at times

  • 25 6 * * * daily
  • 47 6 * * 7 weekly
  • 52 6 1 * * monthy

I want to adjust times before 01:00am.

Is there any particular reason to set the times after 04:00am or 06:00am?

Do I need to pay attention on anything but overriding rules?

share|improve this question

migrated from stackoverflow.com Jul 3 '11 at 12:05

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

Generally, if your work process permits it, you can set your cronjobs at any time as long as it does not impact production.

Howeever, it is worth noting that day savings kick in at around 1-2 am, so if you do have a job set around those times, it may either start up twice or not start at all. So take that into consideration when scheduling your tasks.

share|improve this answer
1  
If you use the cron.daily directory that many crontab installations include, then the DST problem shouldn't be a factor; open a man page for cron(8) and search for "daylight". –  Kevin M Jul 7 '11 at 4:43
    
Very true. It is less of an issue with modern linux distributions. I was thinking how it may be a problem with some legacy Unix installations. I know that the case with IRIX 6.4/5. :| –  Rilindo Jul 7 '11 at 13:45
add comment

I use cron to schedule tasks (like backups) at quiet times when my computer is not likely to be busy performing other tasks.

4AM - 6AM fits this description perfectly.

There is nothing in cron which prevents you scheduling at any time you like.

share|improve this answer
add comment

just edit the times in your cron job files, the second collumn is the hour of day field so thats the one you want to edit eg to set the above jobs to before 1am you would edit them to look like:

25 0 * * * daily
47 0 * * 7 weekly
52 0 1 * * monthy

they will then run between 12 and 1 am instead of 6am

its likely that when your server installed it randomly generated the time (so that it prevents every server in the world checking for an update at exactly the same time which would probably cause a whole lot of problems if they did) there is no particular reason to run them at that time, but it does make most sense to run them outside the general working hours that the server is in most use for.

share|improve this answer
    
That will cause them to run during the noon hour instead of during the midnight hour. Crontabs use 24-hour time; He would want to change them to 0. –  Kevin M Jul 3 '11 at 13:03
    
He probably has his daily crontab set to run(by default) at 4:02am, not a random time. If your computer is awake at 4am, then chances are that it won't care if it hits a server busy doing something for everyone in the world. However, by setting daily for 4:02am, weeklys for 4:22 and monthlys for 4:42, it ensures that your jobs(which may have a resource conflict) won't conflict with each other. –  Kevin M Jul 3 '11 at 13:08
    
@kevin_m, thanks edited, i meant that its probably a value thats generated randomly when the system is first installed and of course seperate to avoid any conflicts –  anthonysomerset Jul 4 '11 at 7:14
    
I've installed quite a few systems(red-hat based, most of them) and whenever I check, they're ALL that way. Kind of makes it hard to believe in a "random" time, even if it is chosen at OS install time. –  Kevin M Jul 7 '11 at 4:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.