Ron Hunter-Duvar wrote:
> On January 11, 2006 12:41, Mikkel L. Ellertson wrote:
> 
> ...
> 
>>
>>The entries in the /etc/cron.* directories are not run directly by
>>cron. What happens is that /usr/bin/run-parts is run by cron
>>because of the /etc/crontab entries, and run-parts then takes care
>>of running the scripts. So even if crontab -l did show the jobs run
>>from /etc/crontab, all it would show is the run-parts jobs. One last
>>note - run-parts does not have to be run by cron. You could use it
>>to run any directory of scripts.
>>
>>Mikkel
> 
> 
> Thanks for the explanation. I figured it was something like that, system 
> versus user job scheduling (though I would think that root cron jobs could be 
> used for system level activities). I noticed that run-parts thing. That's an 
> interesting piece of functionality to keep in mind.
> 
The reason for the separation between root's cron jobs and the
system cron jobs is that sometime you have system cron jobs that
run as a different user. The user used may be a system user, such
as lp, daemon, or apache. It depends on the access the job needs.

> Calling it "crontab" in /etc seems slightly confusing to me, when it's not 
> part of cron at all.
> 
/etc/crontab is part of cron - it is the system cron table. What are
not part of the standard cron package are the /etc/cron.*
directories. That is why the run-parts command is called from
/etc/crontab to run the scripts.

> So just out of curiosity, if it's not the cron daemon that drives this, what 
> does?
> 
The cron daemon runs the run-parts program. The run-parts program
does the rest. The thing to keep in mind is that the run-parts
program only runs the scripts once. Cron runs it as dictated by
the entries in /etc/crontab, feeding it the rest of the command
line so it knows what directory to find the scripts in. Another way
to say it is that every hour, it runs, as root:

run-parts /etc/cron.hourly

Every day at 4:02 it runs "run-parts /etc/cron.daily" and so forth.
The "nice -n 19" part of the command line set the priority to 19.
(The lowest priority a process can have.)

The crontab program does not edit /etc/crontab. This file is
normally edited by hand, though I think there is a GUI to do it.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
____________________________________________________
Want to buy your Pack or Services from Mandriva? 
Go to http://store.mandriva.com
Join the Club : http://www.mandrivaclub.com
____________________________________________________

Reply via email to