On 2024-02-27 at 14:09, Gary Dale wrote:

> On 2024-02-27 10:26, The Wanderer wrote:
>
>> On 2024-02-27 at 10:15, Gary Dale wrote:
>>
>>> Anyway, that got me down the rabbit hole to try to find where the
>>> crontab file is.
>>>
>>>    ls -l /root/cron*
>>> ls: cannot access '/root/cron*': No such file or directory
>>>
>>> also
>>>
>>> # whereis crontab
>>> crontab: /usr/bin/crontab /etc/crontab /usr/share/man/man1/crontab.1.gz
>>> /usr/share/man/man5/crontab.5.gz
>>>
>>> so it's not in the location that you'd expect.
>> 
>> I'm not sure whereis is suitable for finding things like this. As
>> its man page states, it's for finding "the binary, source, and
>> manual page files for a command" - not the data files which the
>> command may work with.
> 
> locate crontab also fails to find it,

That would be because updatedb is configured to exclude /var/spool and
everything underneath it. Look at /etc/updatedb.conf; you'll probably
find that PRUNEPATHS is set to include /var/spool. (It is on my system,
and I'm reasonably certain that it's by default.)

> as does find / -name crontab

Invoked how? In particular, as which user?

Assuming that the crontab files are actually named literally 'crontab'
with no extra characters (perhaps by being stored one per directory), my
guess would be that this is because /var/spool/cron/crontabs is not
world-executable, and therefore most users won't be able to list its
contents. If you run that 'find' command as root, or as a user which is
in the group that owns the directory, you may see that the files show
up.

(If they aren't literally named just 'crontab' verbatim, then you'd also
need to specify wildcards etc. in the find arguments, in order for it to
recognize them as being a valid match.)

>>> Nor can I find it in /etc/. The various cron files there don't 
>>> contain the lines I;m looking for.
>>> 
>>> Can anyone explain how Trixie is handling crontabs now?
>> 
>> The first paragraph of crontab(1) states:
>> 
>>>> Each user can have their own crontab, and though these are
>>>> files in /var/spool/cron/crontabs,they are not intended to be
>>>> edited directly.
>> 
>> So, while I don't use per-user crontabs myself and so don't have 
>> experience with this personally, I would suggest looking in that 
>> directory - but not necessarily editing the files there, except
>> via 'crontab -e' as you have already done.
> 
> Thanks. I missed that when I was reading the comments.  I need to 
> enlarge the text more, I guess.

It took a bit of careful looking for me, too, even when I was fairly
sure something like this would be in there.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to