• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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