Running anacron script

NethServer Version: 7.6

Hi everyone . my server neth ver. 7 regularly performs anacron programming, executing the cron.daily, cron.weekly, etc. scripts.
Often he makes several attempts before completing the scripts, here’s how:

Aug 24 10:01:01 neth7 anacron [18869]: Job cron.daily 'locked by another anacron - skipping Aug 24 10:01:01 neth7 anacron [18869]: Jobcron.weekly 'locked by another anacron - skipping

Can anyone tell me which process prevents the execution of anacron ??
Thank you

Do you have jobs in /etc/crontab ? If yes, test if the errors still occur after commenting them out.

You may try if the following solves your issue:

Get the PIDs of the running cron processes:

ps aux | grep cron

Kill them with kill -9 <PIDs>.

Start crond again:

systemctl restart crond

Thank you as soon as possible I will carry out the necessary checks.

Hi, I checked in / etc / crontab but it is empty or without a job. Performing the status of the processes here is what appears from the image.

Why are you using anacron?
It’s needed if the server is not running continuously.

https://linux.die.net/man/8/anacron

The job is already running so anacron does not start a new job. Nothing to worry about if the jobs are done.

Anacron is installed and run by default on the server to process all jobs on daily, weekly, etc. Do I need to change anything related to anacron or disable it? If yes, how can I act correctly?

AFAIK crond is used by default.

https://www.tecmint.com/cron-vs-anacron-schedule-jobs-using-anacron-on-linux/

Seems you enabled anacron here.

Yes, please disable and stop anacron:

systemctl disable anacron
systemctl stop anacron

ok then i try to disable anacron. Thanks for your kindness !

root@neth7 ~]# systemctl disable anacron

Failed to execute operation: No such file or directory

Sorry. My fault. I thought it can be enabled/disabled.
Cron runs anacron in /etc/cron.hourly/0anacron so if the jobs are completed without errors, you can ignore the “locked by another anacron” errors.

1 Like

Hi, thanks for the directions. I noticed that only the following is stated in etc / cron.d:

Run the hourly jobs

SHELL = / bin / bash
PATH = / sbin: / bin: / usr / sbin: / usr / bin
MAILTO = root
01 * * * * root run-parts /etc/cron.hourly
0hourly (END)

After removing anacron, do the rest need to be added to perform the rest of the daily, weekly and monthly jobs?
You could make a cat of your file of…

Sorry, I think I wasn’t clear enough.
You don’t need to delete or add files or remove anacron.
If there are no errors about the jobs itself, you don’t need to change anything.