[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: questions about cron.daily



On Thu 06 Apr 2023 at 12:28:05 (-0700), Fred wrote:
> On 4/6/23 09:44, Pierre Frenkiel wrote:
> > 
> > crontab -l
> > 
> > On Thu, 6 Apr 2023, Fred wrote:
> > > I also would like to know when cron.daily scripts run.  Greg's
> > > command does not appear to reveal the time for that script.  I
> > > ran Greg's command and got the same result.
> 
> fred@ragnok:~$ crontab -l
> no crontab for fred
> 
> root@ragnok:/home/fred# crontab -l
> no crontab for root

Users (including root) write their crontabs anywhere they like,
typically in a directory like ~/.cron/. They then have to be installed
with crontab, which copies them into /var/spool/cron/crontabs/.
Those are the files that crontab -l lists. Why? Because cron isn't
going to poke around in your home directory looking for a crontab
there. It wants them somewhere it has control over.

The system crontab is different, and is found in /etc/. It is an
active file, and doesn't require any installing. It also has to
contain an extra field: the user under which each item should be
run—usually, but not always, root. Other parts of the system can
also have their own crontabs, with similar properties, which are
found in /etc/cron.d/.

Cheers,
David.


Reply to: