Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(CRON) error (can't fork)

Tags:

cron

Ubuntu 16.

sudo crontab -e
* * * * * uptime >> /www/w100/log/uptime.log

But nothing happens (uptime >> /www/w100/log/uptime.log work's fine).

grep CRON /var/log/syslog
May 20 21:39:01 cs25795 CRON[28233]: (CRON) error (can't fork)

Why my cron is so buggy? (

like image 964
Tim Avatar asked Aug 15 '26 00:08

Tim


1 Answers

If you see the (CRON) error (can't fork) message, it means that:

  • your system is running out of memory
  • cron can't create the process (due to high memory)

For example, I have a server running with 4 GiB of RAM (3.70 GiB usable), cron wasn't able to start other jobs. I checked my memory using htop and it shown 3.26 GiB used.

What you can do is find out which process is taking up all the memory (using for example htop), kill it and disable it ; or you can just reboot your system. (in my case it was a bot that used over 1 GiB)

like image 187
Minteck Avatar answered Aug 17 '26 14:08

Minteck