On Dec 11, 2021, at 09:03, Patrick Dupre <pdupre(a)gmx.com> wrote:
I am trouble because I guess that crond and anacron
run are very close times.
Hence, they start a backup when another backup is running.
This creates real problems.
What do you recommend?
Running only crond or only anacron?
Usually, this machine runs every day for at least 1-2 hours
durin the week, and a long loner during the week-end (when backuo
is run).
However, it may happen that the machine is not run during several weeks.
Anacron is a dependency for cronie (the cron daemon) and is normally enabled. In your
case, most likely it is just running the /etc/cron.daily or /etc/cron.weekly jobs you have
defined, when you boot your system.
The thing is, Anacron only runs if you boot after the scheduled job is supposed to run out
of cron. It shouldn’t run twice. So maybe you have your backups scheduled in more than
one place?
Anyway, I agree with the others, use a lock file to prevent running simultaneous backup
jobs. There are ways to do this with simple shell logic, with the “dotlockfile”
executable.
—
Jonathan Billings