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


Groups > linux.debian.user > #256982

Re: questions about cron.daily

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: questions about cron.daily
Date 2023-04-09 18:10 +0200
Message-ID <GiFM5-TfL-7@gated-at.bofh.it> (permalink)
References (2 earlier) <GhAOt-cNY-1@gated-at.bofh.it> <GhAY9-cRA-7@gated-at.bofh.it> <GhDt1-et2-19@gated-at.bofh.it> <GhGAx-gn1-5@gated-at.bofh.it> <GhGKd-gqq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 06 Apr 2023 at 18:54:31 (-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.

Well, it's pretty normal if you use the first form of the command,
though there's no special need for it to be either in the home
directory or private.

> Most people just use "crontab -e" to edit the system's copy of their
> personal crontab...
> 
> > They then have to be installed
> > with crontab, which copies them into /var/spool/cron/crontabs/.
> 
> ... which lives there.

That's the workflow I might have used thirty years ago when I was
a plain old user of a university unix system with likely zero to
one lines of crontab and no need to think about backups. But that's
the old normal, which I'd find rather inflexible now. For example,
if you're busy editing crontab and it's time to go home, then you
either save it and it immediately becomes the active copy, or you
abandon editing, or you save it to some file before abandoning.
Say what? Isn't that a private copy?

Next month, or whenever, I'll be installing bookworm into the other
root partition on this machine. I'll want to copy (and preen, maybe)
my personal crontab from bullseye into bookworm.

IOW, while I run crontab -e on bookworm, inside my emacs session,
I want a subshell to run crontab -l, but the latter has to run on
bullseye in order to pick up the old crontab. I'm not sure how
I would do that.

Before very long, I'll be travelling again, taking one of my
laptops with me. It's roles at home and away are completely
different, so I switch crontabs for the duration, not with
crontab -e but with crontab ~/.cron/<appropriate-crontab>.
And that command is in a script that takes care of other
changes that need to be made for its travelling role.

I populate my ~/.cron directory with anything to do with cron,
like the scripts¹ that some crontab entries run, the crontabs
that I push to my other machines, and a copy of root's crontab
for when the occasion might arise to migrate a personal job to
being a systemwide one. And as it's all under my home directory,
it gets backed up too. (I don't backup /var/spool/.)

I also keep there the ephemeral files that control unattended
recording of live radio (via LineInput), because that system is
driven by a cron job running each minute. So an empty file like
.cron/2023-04-09-06-55-rk2wav-190 would record three hours on
Sunday morning. (I've been running this for over two decades,
though it doesn't get a fraction of the use that it did in the
days before BBC iplayer.)

¹ ISTR you had misgivings about that a couple of years ago.

Cheers,
David.

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