CyberPanel Community

cron jobs not running

Ja
Jabberwock #1

Hi Community,

I have a problem with setting a cron job via CyberPanel 1.9.4
I set a cron job that runs every minute, exactly like the guide
that echo a string to a file.
echo “run” > /home/domain.com/public_html/log.txt
created the file and gave it 777 permissions.
Through the SSH it runs fine, even used the “su user” command to make sure it has the right permissions.
Now, I can see the cron jobs I created in the path /var/spool/cron/crontabs/user
But what is calling it? Maybe the problem is there and I will be able to trace the problem

3 replies
Ja
Jabberwock #2

Okay I’ve found the problem, when you run “service cron status” you can see the error.
INSECURE MODE (mode 0600 expected) (crontabs/user)
It refuses to run because of wrong permissions
what you need to do is locate the file in /var/spool/cron/crontabs/user
then set chmod to 600
then it will run fine.
another problem is that if you have 2 crons and you remove one of them, everything will be deleted

bm
bmoses #3

I am also having an issue… Tried different commands eg “php -q /home/{domain}/public_html/CronTest.php run”

Noticed when logging on Terminal opened the “home” directory, I can see the domain folder. When trying to open the domain folder it says “permission denied”.

Any ideas for fixing this please?

so
souzadavi #4

Type your comment> @bmoses said:

I am also having an issue… Tried different commands eg “php -q /home/{domain}/public_html/CronTest.php run”

Noticed when logging on Terminal opened the “home” directory, I can see the domain folder. When trying to open the domain folder it says “permission denied”.

Any ideas for fixing this please?

Type su sudo than you can go on.

Sign in to reply