Last time I checked, cron.daily is called with a line similar to this:


25 6    * * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily

In other words, it gets run once per day.

cron.daily is a great place to put things that should happen once each day, but you don't care particularly when they happen. It's a terrible place to put things that should happen just once, but at a particular time of day.

/etc/crontab is one place you could put your job; another would be the personal crontab for the root user (or even better: give a less-privilived user access to /sbin/shutdown via passwordless sudo, and put the command in that user's crontab).

I'd consider using at(1) rather than cron(8) though:

[EMAIL PROTECTED]:~$ whatis at
at (1)               - queue, examine or delete jobs for later execution



On 8/14/06, Dean Hamstead <[EMAIL PROTECTED]> wrote:
cron.daily is run from crontab, either will be ok



Dean

bill wrote:
> I have mythdora ( Redhat FC4 based) running more or less - at least t
> the degree that I can record TV programs.
>
> I want to auto-shutdown the PC after recording has finished.
>
> Googling gives plenty of links/info, which often is contradictory.
>
> Basically, I believe that I need to put an entry such as
>
> 00 20 14 08  mon root /sbin/shutdown -h now
>
> (to shutdown the PC at 10PM this evening - 20/08/06)
>
> in EITHER:-
>
> /etc/crontab
>
> or
>
> /etc/cron.daily
>
> Which is correct please?
>
> Thanks
>
> Bill
>
>

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html




--
There is nothing more worthy of contempt than a man who quotes himself - Zhasper, 2004
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to