1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Scheduled Tasks (CronJob) not working

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by blind, Oct 13, 2011.

  1. blind

    blind Guest

    0
     
    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.
     
  2. Hostasaurus.Com

    Hostasaurus.Com Regular Pleskian

    30
    68%
    Joined:
    Oct 8, 2009
    Messages:
    465
    Likes Received:
    8
    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.
     
  3. blind

    blind Guest

    0
     
    Thank you. I have changed now to /bin/bash and it seems it works. I hope also they will manage to fix.
     
  4. breun

    breun Golden Pleskian

    29
     
    Joined:
    Jun 28, 2005
    Messages:
    1,647
    Likes Received:
    0
  5. Hostasaurus.Com

    Hostasaurus.Com Regular Pleskian

    30
    68%
    Joined:
    Oct 8, 2009
    Messages:
    465
    Likes Received:
    8
Loading...