See man crontab.

There are 2 ways of maintaining your crontab:

crontab [ -u user ] file
...
The first form of this command is used to install a new crontab from some named file....

I.e. you can keep a file in your home directory (or anywhere,) update it and install it when changed using "crontab filename". This is especially useful if you keep your home directory under version control and want your crontab under version control as well. But I guess hardly anyone does this.

The second way:

crontab [ -u user ] [ -i ] { -e | -l | -r }
...
The -e option is used to edit the  current  crontab  using  the  editor
specified  by  the  VISUAL  or EDITOR environment variables.  After you
exit from the editor, the modified crontab will be installed  automatiā€
cally.

I believe it actually causes the current crontab to be copied to a temporary file, where is edited, then it is installed after a successful editing session and the temporary file is deleted.

Like others, I've hardly ever met people who do things the first way, but it likely was the original way of doing things.

Thanks,
Alex

On 7/04/23 17:08, to...@tuxteam.de wrote:
On Thu, Apr 06, 2023 at 06:54:31PM -0400, Greg Wooledge wrote:
On Thu, Apr 06, 2023 at 05:45:08PM -0500, David Wright wrote:
Users (including root) write their crontabs anywhere they like,
typically in a directory like ~/.cron/.
Is that... normal?  I can't say I've ever seen anyone keep a private
copy of their crontab in their home directory like that.
It's news to me, too. I olny knew about the /var/spool/cron/crontabs
location.

Cheers

Reply via email to