Crons not working

dorucrisan

Verified User
Joined
Oct 23, 2021
Messages
216
Location
Bucharest / Romania
I just discovered that crons are not running on one of my DA servers since September. There are 3 dates when each of the sites (around 40) stopped executing the crons, not all stopped the same date. All are daily crons. There is no sintax error or something of this kind to suspect, as all crons used to work as they are now, for the past 2 years or so. Exactly same crons works jus fine on other DA servers I have. I suspect something happened during some update or something of this kind. Problem is that crons are not starting, are not initiated by DA, not that starts and, for some reason do not finish. Is there anything I need to test/check or do to make crons work again. Thanks in advance. I have several accounts on that server (4) but all crons are on admin account if that matters. It used to work like that for a lomng time before.
 
In DirectAdmin (At least my copies) /var/log/cron doesn't exist, and the cron entries appear in /var/log/syslog

[Using Ubuntu 24.04 ESM]
 
Check if the cron service is running and if other crons (monthly etc) are running or not.
Restart the crond service, check for typo's in the cron files.

grep -i cron /var/log/* or journalctl -u crond to check if anything is happening.

Did you turn it off and on again? :)
 
1762084088942.png


How can I start/restart/ install cron service?
There is something wrong here.
 
It's not cron service it's crond service.

Check if it's running like this:
systemctl status crond
Thanks Richard,
Here is the result:

login as: root
[email protected]'s password:
Last login: Sun Nov 2 17:21:14 2025 from 82.76.52.14
[root@host ~]# systemctl status crond
● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; preset: en>
Active: active (running) since Sun 2025-11-02 17:23:47 EET; 2h 7min ago
Main PID: 1291 (crond)
Tasks: 1 (limit: 820250)
Memory: 2.1M
CPU: 378ms
CGroup: /system.slice/crond.service
└─1291 /usr/sbin/crond -n

Nov 02 17:23:47 host crond[1291]: (CRON) INFO (running with inotify support)
Nov 02 17:57:01 host crond[1291]: (admin) RELOAD (/var/spool/cron/admin)
Nov 02 18:01:01 host CROND[13094]: (root) CMD (run-parts /etc/cron.hourly)
Nov 02 18:01:01 host run-parts[13098]: (/etc/cron.hourly) starting 0anacron
Nov 02 18:01:01 host run-parts[13104]: (/etc/cron.hourly) finished 0anacron
Nov 02 18:01:01 host CROND[13092]: (root) CMDEND (run-parts /etc/cron.hourly)
Nov 02 19:01:01 host CROND[21769]: (root) CMD (run-parts /etc/cron.hourly)
Nov 02 19:01:01 host run-parts[21772]: (/etc/cron.hourly) starting 0anacron
Nov 02 19:01:01 host run-parts[21778]: (/etc/cron.hourly) finished 0anacron
Nov 02 19:01:01 host CROND[21768]: (root) CMDEND (run-parts /etc/cron.hourly)
lines 1-20/20 (END)...skipping...
● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; preset: en>
Active: active (running) since Sun 2025-11-02 17:23:47 EET; 2h 7min ago
Main PID: 1291 (crond)
Tasks: 1 (limit: 820250)
Memory: 2.1M
CPU: 378ms
CGroup: /system.slice/crond.service
└─1291 /usr/sbin/crond -n

Nov 02 17:23:47 host crond[1291]: (CRON) INFO (running with inotify support)
Nov 02 17:57:01 host crond[1291]: (admin) RELOAD (/var/spool/cron/admin)
Nov 02 18:01:01 host CROND[13094]: (root) CMD (run-parts /etc/cron.hourly)
Nov 02 18:01:01 host run-parts[13098]: (/etc/cron.hourly) starting 0anacron
Nov 02 18:01:01 host run-parts[13104]: (/etc/cron.hourly) finished 0anacron
Nov 02 18:01:01 host CROND[13092]: (root) CMDEND (run-parts /etc/cron.hourly)
Nov 02 19:01:01 host CROND[21769]: (root) CMD (run-parts /etc/cron.hourly)
Nov 02 19:01:01 host run-parts[21772]: (/etc/cron.hourly) starting 0anacron
Nov 02 19:01:01 host run-parts[21778]: (/etc/cron.hourly) finished 0anacron
Nov 02 19:01:01 host CROND[21768]: (root) CMDEND (run-parts /etc/cron.hourly)
~
~
~
~
~
~
~
~
~
lines 1-20/20 (END)
● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; preset: enabled)
Active: active (running) since Sun 2025-11-02 17:23:47 EET; 2h 7min ago
Main PID: 1291 (crond)
Tasks: 1 (limit: 820250)
Memory: 2.1M
CPU: 378ms
CGroup: /system.slice/crond.service
└─1291 /usr/sbin/crond -n

Nov 02 17:23:47 host crond[1291]: (CRON) INFO (running with inotify support)
Nov 02 17:57:01 host crond[1291]: (admin) RELOAD (/var/spool/cron/admin)
Nov 02 18:01:01 host CROND[13094]: (root) CMD (run-parts /etc/cron.hourly)
Nov 02 18:01:01 host run-parts[13098]: (/etc/cron.hourly) starting 0anacron
Nov 02 18:01:01 host run-parts[13104]: (/etc/cron.hourly) finished 0anacron
Nov 02 18:01:01 host CROND[13092]: (root) CMDEND (run-parts /etc/cron.hourly)
Nov 02 19:01:01 host CROND[21769]: (root) CMD (run-parts /etc/cron.hourly)
Nov 02 19:01:01 host run-parts[21772]: (/etc/cron.hourly) starting 0anacron
Nov 02 19:01:01 host run-parts[21778]: (/etc/cron.hourly) finished 0anacron
Nov 02 19:01:01 host CROND[21768]: (root) CMDEND (run-parts /etc/cron.hourly)
~
~
~
~
~
~
~
~
~
lines 1-20/20 (END)
 
So that means the crond service is running and enabled on startup (so after start or reboot) and cron tasks should be executed.

Is it a backup cron or something which is running daily or which kind of cron? Can you post one of the crons which should be running and which is not running now?
 
So that means the crond service is running and enabled on startup (so after start or reboot) and cron tasks should be executed.

Is it a backup cron or something which is running daily or which kind of cron? Can you post one of the crons which should be running and which is not running now?
Yes of course Richard. Allow me to explain please. There are many crons, none of them are working. Most are running (supposed to run) on daily basis, others, once a week. It does not matter what the cron does, there are not working, does not start. Some are cleaning db's, nothing works.
Most important are crons like these two examples below, they load a feed with updated products and prices from supplier's warehouses. Used to work for years on same server, don't know what has happened. I made a fresh install followed by a full restore recently, not sure if that caused it, didn't check and I just noticed the situation. Fact is no cron of any kind that I add now s working, does not start, not that cannot finish. Running crons manually from the bar it is working just fine.
Is there a way to reinstall DA and keep everything else in place? Maybe some file is broken somewhere.

1762145400409.png


 
Last edited:
can you test the cronjob by put the simple command ... like this


#every second : * * * * *
Code:
echo "1" > ~/test_cron.log 2>&1

User home directory should content the log file.
 
It's always best practice to add the full path to anything in your cron. If for soms reason your path of wget changed, it won't run anymore.
 
Then maybe it's relate to the site just stop working for a moment and the cronjob not have any retry mechanism.


#Idea#
I suggest design the new cronjob task to check the datetime from the php code ( if it's run or not ) and push the cronjob as every 2hr, if one fail then it's will retry later.
 
Then maybe it's relate to the site just stop working for a moment and the cronjob not have any retry mechanism.


#Idea#
I suggest design the new cronjob task to check the datetime from the php code ( if it's run or not ) and push the cronjob as every 2hr, if one fail then it's will retry later.
there are 50 sites, for none of them is working. crons are nor running at given time. all have their own log. there is a system problem, not site related. How can I restore DA?
 
No clue yet, please create support ticket or hire someone to check.

Just put the simple cronjob to check if it run at the time or not.
 
Is it possible there is a permission/ownership problem in the /var/spool/cron directory? It could be silently failing reading the directory and not processing any of the user crons.
 
Back
Top