Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #256858

Re: questions about cron.daily

From "Andrew M.A. Cater" <amacater@einval.com>
Newsgroups linux.debian.user
Subject Re: questions about cron.daily
Date 2023-04-08 11:10 +0200
Message-ID <GicK5-B3i-5@gated-at.bofh.it> (permalink)
References <GhMwh-kk3-1@gated-at.bofh.it> <Gi4tb-vAK-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Apr 08, 2023 at 11:45:50AM +1200, Alex King wrote:
> 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.
> 

This is *exactly* what I do when I'm editing crontabs, especially on a 
remote machine. 

crontab -l

lists any crontabs for that user.

 crontab -l > crontab.old

gives you a version of the crontab that you can keep.

cp crontab.old crontab.new ; vi crontab.new ; diff crontab.old crontab.new

will allow you to add new lines / change times or whatever.

crontab crontab.new will put the new crontab in - but you've already got
the old one if you need to revert changes. If you want to be fancy, you
can do crontab.<iso8601 date> and have them sorted.

Likewise for creating systemd unit files - NEVER "just start editing over
the top" always have an example to work from and save it. You can then
commit the series to git if you want to record exact changes.

> 
> 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.
> 

Yes,

> 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
> 
>

All the very best, as ever,

Andy 

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

questions about cron.daily coreyh@free.fr - 2023-04-06 13:40 +0200
  Re: questions about cron.daily Greg Wooledge <greg@wooledge.org> - 2023-04-06 13:50 +0200
  Re: questions about cron.daily Andy Smith <andy@strugglers.net> - 2023-04-06 17:40 +0200
    Re: questions about cron.daily Fred <fred@blakemfg.com> - 2023-04-06 18:40 +0200
      Re: questions about cron.daily Pierre Frenkiel <frenkiel@gmail.com> - 2023-04-06 18:50 +0200
        Re: questions about cron.daily "Thomas Schmitt" <scdbackup@gmx.net> - 2023-04-06 19:10 +0200
          Re: questions about cron.daily Alexis Grigoriou <alexis@nanoid.net> - 2023-04-06 20:30 +0200
        Re: questions about cron.daily Fred <fred@blakemfg.com> - 2023-04-06 21:30 +0200
          Re: questions about cron.daily David Wright <deblis@lionunicorn.co.uk> - 2023-04-07 00:50 +0200
            Re: questions about cron.daily Greg Wooledge <greg@wooledge.org> - 2023-04-07 01:00 +0200
              Re: questions about cron.daily <tomas@tuxteam.de> - 2023-04-07 07:10 +0200
                Re: questions about cron.daily Alex King <alex@rimuhosting.com> - 2023-04-08 02:20 +0200
                Re: questions about cron.daily "Andrew M.A. Cater" <amacater@einval.com> - 2023-04-08 11:10 +0200
                Re: questions about cron.daily Michel Verdier <mv524@free.fr> - 2023-04-08 11:20 +0200
                Re: questions about cron.daily Greg Wooledge <greg@wooledge.org> - 2023-04-08 14:40 +0200
                Re: questions about cron.daily Max Nikulin <manikulin@gmail.com> - 2023-04-08 17:20 +0200
                Re: questions about cron.daily Kushal Kumaran <kushal@locationd.net> - 2023-04-08 17:20 +0200
                Re: questions about cron.daily Max Nikulin <manikulin@gmail.com> - 2023-04-08 19:00 +0200
                Re: questions about cron.daily Michel Verdier <mv524@free.fr> - 2023-04-09 10:00 +0200
                Re: questions about cron.daily Max Nikulin <manikulin@gmail.com> - 2023-04-11 11:20 +0200
                Re: questions about cron.daily Michel Verdier <mv524@free.fr> - 2023-04-09 10:00 +0200
              Re: questions about cron.daily Richard Hector <richard@walnut.gen.nz> - 2023-04-07 18:00 +0200
              Re: questions about cron.daily Anssi Saari <as@sci.fi> - 2023-04-07 18:00 +0200
                Re: questions about cron.daily Cindy Sue Causey <butterflybytes@gmail.com> - 2023-04-07 23:50 +0200
              Re: questions about cron.daily David Wright <deblis@lionunicorn.co.uk> - 2023-04-09 18:10 +0200
                Re: questions about cron.daily zithro <slack@rabbit.lu> - 2023-04-09 21:50 +0200
                Re: questions about cron.daily David Wright <deblis@lionunicorn.co.uk> - 2023-04-10 03:30 +0200
                Re: questions about cron.daily davidson <davidson@freevolt.org> - 2023-04-10 04:30 +0200
                Re: questions about cron.daily Michel Verdier <mv524@free.fr> - 2023-04-10 08:40 +0200
                Re: questions about cron.daily David Wright <deblis@lionunicorn.co.uk> - 2023-04-11 05:50 +0200
                Re: questions about cron.daily zithro <slack@rabbit.lu> - 2023-04-10 17:50 +0200
                Re: questions about cron.daily David Wright <deblis@lionunicorn.co.uk> - 2023-04-11 05:50 +0200
      Re: questions about cron.daily Tom Furie <tom@furie.org.uk> - 2023-04-06 19:00 +0200
      Re: questions about cron.daily Michel Verdier <mv524@free.fr> - 2023-04-06 19:10 +0200
      Re: questions about cron.daily Greg Wooledge <greg@wooledge.org> - 2023-04-06 19:50 +0200
      Re: questions about cron.daily Stefan Monnier <monnier@iro.umontreal.ca> - 2023-04-06 19:50 +0200
      Re: questions about cron.daily davidson <davidson@freevolt.org> - 2023-04-06 23:30 +0200
        Re: questions about cron.daily ken@openmbox.net - 2023-04-07 02:20 +0200
          Re: questions about cron.daily Tom Furie <tom@furie.org.uk> - 2023-04-07 02:30 +0200
            Re: questions about cron.daily Dan Ritter <dsr@randomstring.org> - 2023-04-07 03:50 +0200

csiph-web