LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-16-2015, 12:31 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
crontab job.


hi,
I an CentOS 6.5,under /etc there is "cron.d" folder which contain system related jobs,I can also see "cron.daily" , "cron.houry" , "cron.monthly" and "cron.weekly" .
The thing which I want to understand is what are the purpose of these folders ?

Suppose I want that the system should daily shutdown automatically at 7:00 pm daily.I use the command

Code:
# crontab -e
0 19 * * * /sbin/shutdown -h now
Using this my system shutdown successfully. The question is when this command is executed does it refer to or gives signals to "cron.daily" to do further work at back end side ?

In short I want to know the mechanism how cron works ,what are the purpose of "cron.daily" , "cron.houry" , "cron.monthly" and "cron.weekly" folders ? Does they also keep system related task aas well ?
thanks

Last edited by gardenair; 11-16-2015 at 12:46 AM.
 
Old 11-16-2015, 01:15 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The folders and the commands you add via crontab -e are not related. You can use the folders to conveniently run commands daily etc., but for full control of timing use the crontab command.
 
Old 11-16-2015, 04:00 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Yes, the cron.hourly, cron.daily, cron.weekly and cron.monthly are for automated system related tasks i.e logrotate, updating mlocate database etc. As stated they are unrelated to adding a users cron job via cron -e.
 
1 members found this post helpful.
Old 11-16-2015, 04:20 AM   #4
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks for your replies.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] crontab job disable toniotosi Linux - Newbie 4 06-23-2011 05:12 AM
the crontab job is not run ust Linux - Software 1 03-24-2008 07:03 PM
Run crontab job sunhui Linux - Software 2 05-16-2007 08:35 PM
crontab job Thulemanden Linux - Software 2 07-09-2006 06:57 AM
crontab job entry notolerance Linux - Software 2 02-20-2005 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 07:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration