Cron run jobs but nothing happens

Discussion in 'General' started by [email protected] Rasta, May 2, 2019.

Tags:
    1. I have created a client, website, ftp-user and shell-user;
    2. Created cron jobs with this parent website, Log output checked and the following command:
      Code:
      touch /var/www/clients/client1/web13/private/TEST && echo "TEST"
    3. Connected to server via ssh and tested command:
      Code:
      touch /var/www/clients/client1/web13/private/TEST && echo "TEST"
    4. Got the output to the console "TEST" and file was created.
    But file isn't updating every minute as expected and there are no /private/cron.log nor /private/cron_error.log in /var/www/clients/client1/web13/
    Maybe the problem in "chrooted"? My other site cron job list in cron.d was created without this "chrooted" prefix and they work just fine.
    Code:
    ls /etc/cron.d | grep web13
    ispc_chrooted_web13
    [email protected]:/etc/cron.d# cat /etc/cron.d/ispc_chrooted_web13
    MAILTO=''
    SHELL='/usr/sbin/jk_chrootsh'
    
    *    *    *    *    *    web13    touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website
    Code:
    cat /var/log/syslog | grep TEST
    May  2 14:08:01 myserver CRON[40378]: (web13) CMD (echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:09:01 myserver CRON[40413]: (web13) CMD (echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:10:01 myserver CRON[40529]: (web13) CMD (echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:11:01 myserver CRON[40640]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:12:01 myserver CRON[40664]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:13:01 myserver CRON[40693]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:14:01 myserver CRON[40716]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:15:01 myserver CRON[40737]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:16:01 myserver CRON[40824]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:17:01 myserver CRON[40847]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:18:01 myserver CRON[40987]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:19:01 myserver CRON[41030]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    May  2 14:20:01 myserver CRON[41057]: (web13) CMD (touch /var/www/clients/client1/web13/private/TEST && echo "TEST" >>/private/cron.log 2>>/private/cron_error.log #website)
    Code:
    [email protected]:/var/log# lsb_release -a
    No LSB modules are available.
    Distributor ID:    Ubuntu
    Description:    Ubuntu 18.04.2 LTS
    Release:    18.04
    Codename:    bionic
    
    [email protected]:/etc/cron.d# grep 'ISPC_APP_VERSION' /usr/local/ispconfig/server/lib/config.inc.php
    define('ISPC_APP_VERSION', '3.1.13p1');
    $conf['app_version'] = ISPC_APP_VERSION;
     
    Last edited: May 2, 2019
  1. till

    till Super Moderator Staff Member ISPConfig Developer

    Linux cronjobs require that you use the full path of a command as the PATH to serafcvh for applications is not set by Linux cron. So its /usr/bin/touch and not just touch. and it's /bin/echo and not echo:

    /usr/bin/touch /var/www/clients/client1/web13/private/TEST && /bin/echo "TEST"

    Then you might have created a jailed cronjob, which means that you have to ensure that the touch and echo command are installed inside the jail and that you adjust the paths to match the jail:

    /usr/bin/touch /private/TEST && /bin/echo "TEST"
     
  2. I used ISPConfig web interface to create cron jobs, how could I create "jailed cronjob" this way? Is there some option in the interface?
    P.S. adding full path have no effect, still not working
    UPD: if you are talking about "Chroot Shell" option when creating a Shell User in ISP Config, it was set to "None". Should I try to set it to "Jailkit" and then switch back to "None" to test maybe? Or how can I be sure that my user and it's jobs are / not jailed?
     
    Last edited: May 3, 2019
  3. I have created new site with new user and have same problem. Any ideas, please?
     
  4. I have logged via SSH using this user, created cron tasks using "crontab -e" and it works like expected. Please, why it's not working when created in ISPConfig WEB-interface? I don't want to create shell user just to connect and create cron tasks using "crontab -e". Isn't "Cron Jobs" for creating cron jobs? What could I miss?
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    There are
    . Client settings specify which kinds of cron jobs are available for the client.
     
  6. Thanks! The problem was that I was doing everything from "Admin" account. When I logged on as client everything became clear.
     

Share This Page