Cpanel does not run my cron jobs
Asked Answered
C

3

6

I have cron jobs in cPanel that are scheduled every night. Yesterday, I noticed that these cron jobs haven't run since 2 days ago. I checked the cron log in /var/log/cron, and it shows me errors when trying to access the file.

Errors:

Nov  6 11:25:01 web2 crond[17439]: (laptoplc) ERROR (failed to change user)
Nov  6 11:25:01 web2 crond[17447]: (projecto) ERROR (failed to change user)
Nov  6 11:25:01 web2 crond[17446]: (CRON) ERROR (setreuid failed): Resource temporarily unavailable
Nov  6 11:25:01 web2 crond[17446]: (laptoppa) ERROR (failed to change user)

What could be the problem?

Carbamate answered 6/11, 2013 at 22:52 Comment(2)
What is the cron command you run?Morrissette
What is the entire CRON script? Because it looks like a permissions issue.Lakshmi
D
6

There could be several things caused this. Here are ways to debug your crons:

  1. Run it manually from shell:

    php yourcron.php

  2. Add logging from your cron file, maybe by adding error_log('check if running'); to see if it is indeed running.

As suggested above it could be permission issue too. Add execute permission to your cron:

chmod 755 yourcron.php
Dearr answered 13/11, 2013 at 14:13 Comment(0)
S
1

Check whether any Zombie processes for these users exist using the below command.

ps -eLF |grep -i username

Try killing those processes and check whether cronjobs are running after that.

sudo ps -eLF |grep username |awk '{print $2}' |xargs sudo kill -9 

Dont kill any important running process !

Searby answered 26/11, 2013 at 22:18 Comment(0)
B
-1

I had a similar problem today. The cron in /var/spool/cron/userXXX had a script for /home/userYYY (another user) and so this error occurred. I removed the line that had userYYY and this was resolved.

Boo answered 16/4, 2018 at 18:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.