• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Scheduled Tasks (CronJob) not working

B

blind

Guest
Hello,

I made an migration from previous Plesk 10.0 to the new 10.3.1. All the clients, files and configuration was sucesfully moved, but now I have problems with applied Scheduled Tasks.

In the Panel the tasks are active, I also renabled it again. But they don't start. Also if I check in the shell as root with the command: crontab -l , I don't see the crontab lines of the client.

root@cp /var/www/vhosts/skcapris.si/httpdocs # crontab -l
0 1 * * 1 /opt/psa/libexec/modules/watchdog/cp/secur-check
0 1 * * 1 /opt/psa/libexec/modules/watchdog/cp/send-report weekly
10 1 * * * /opt/psa/libexec/modules/watchdog/cp/clean-sysstats
15 1 * * * /opt/psa/libexec/modules/watchdog/cp/pack-sysstats day
15 1 * * 1 /opt/psa/libexec/modules/watchdog/cp/pack-sysstats week
15 1 1 * * /opt/psa/libexec/modules/watchdog/cp/pack-sysstats month
15 1 1 * * /opt/psa/libexec/modules/watchdog/cp/pack-sysstats year
20 1 * * * /opt/psa/libexec/modules/watchdog/cp/clean-events
0 3 * * 7 /opt/psa/libexec/modules/watchdog/cp/clean-reports


Is there maybe any setting with I have to enable or configure?

Thank you.
 
There's a bug that has not been fixed after months of complaining where cron jobs will not work correctly unless you give the site they're set up under /bin/bash as the shell. If the shell is anything other than /bin/bash, the cron jobs for each domain are set up with the chrooted shell which cannot run anything successfully, making the cron jobs useless.

So, you have a couple options:

1) If you're selling hosting and obviously would not want to give a customer unrestricted shell access, you should probably also take away their access to manage scheduled tasks. Then, you can add them for the customer because every time you add them, you're going to need to hand edit /var/spool/cron/USERNAME and change the first line to /bin/bash instead of the chroot shell.

2) If you're okay with the domain having shell access, just set it to /bin/bash and the cron job will work.

3) If editing the file each time annoys you, you could set the jobs up in the system crontab by hand and specify which user the job is to run as; typically /etc/cron.d/


Or of course if Parallels would fix this issue problem solved. Oh, the reason crontab -l didn't show you what you were expecting to find is because you were logged in as root, -l will only show you root's crontab if you don't also give it -u user to specify the username.
 
Thank you. I have changed now to /bin/bash and it seems it works. I hope also they will manage to fix.
 
Back
Top