cron task not running

Discussion in 'Installation/Configuration' started by Chag, Jul 27, 2021.

Tags:
  1. Chag

    Chag New Member

    Hi,
    I have a cron task not running. I first thought there was something wrong with my command. So I made a simple one in the ispconfig's cron manager.
    Code:
    * * * * * web1 /var/www/mysite.com/web/crontest.sh
    'log output' and 'active' are checked
    I tried with
    Code:
    [web_root]/crontest.sh
    but same result.
    my crontest.sh script is really simple :
    Code:
    #!/bin/bash
    echo `date` >> /var/www/mysite.com/web/cron.test
    
    I tried differents rights up to 777 on the script and it's is owned by user web1
    I can see the task in /var/log/cron/log
    Code:
    Jul 27 22:10:01 srv1 CRON[25552]: (web1) CMD (/var/www/mysite.com/web/crontest.sh >>/private/cron.log 2>>/private/cron_error.log #mysite.com)
    but no file is created. neither cron.test, nor logs in private
    If I try to run that task manually :
    Code:
    sudo -u web1 /var/www/mysite.com/web/crontest.sh >>/private/cron.log 2>>/private/cron_error.log #mysite.com
    everything is created but log files appear in /private, not in /var/www/mysite.com/private as I would expect. I'm runnig out of ideas. Am I missing something obvious ?
     
  2. Chag

    Chag New Member

    figured it out.
    Had to set full cron in limits of user account. Sorry for the noise
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    You can use chrooted cron as well, but in case of a chrooted cron, your script would have to be:

    Code:
    #!/bin/bash
    echo `date` >> /web/cron.test
     

Share This Page