Cronjob won't work

Discussion in 'Installation/Configuration' started by planetcaravan, May 3, 2012.

  1. planetcaravan

    planetcaravan New Member

    Hi,

    I'm using ISP Config 3.0.4.4 on Debian Squeeze/Sid.
    I've setup a script an put it in:
    Code:
    /var/www/clients/client6/mydomain.tld/backup
    Here is the script:
    Code:
    #!/bin/bash
    NOW=$(date +"%m-%d-%Y %T")
    echo -e "File di testo creato: "$NOW >> /var/www/mydomain.tld/backup/log_test.txt
    
    Here is it what I have in my folder:
    Code:
    -rwxrwxrwx  1 web17 client6   84 May  3 00:27 log_test.txt
    -rwxrwxrwx  1 web17 client6  126 May  3 00:25 script.sh
    
    I've setup cronjobs via ISP Config (file attached)

    I'm having this log:
    Code:
    PHP Warning:  mkdir(): File exists in /usr/local/ispconfig/server/plugins-available/cron_jailkit_plugin.inc.php on line 293
    
    I can't see it via crontab -l
    What's wrong?
     

    Attached Files:

  2. dclardy

    dclardy New Member

    Did you chmod +x the script?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess the problem is the script, it is run in a chroot, so the path /var/www/mydomain.tld/ is / from inside the script, so the line:

    echo -e "File di testo creato: "$NOW >> /var/www/mydomain.tld/backup/log_test.txt

    has to be:

    echo -e "File di testo creato: "$NOW >> /backup/log_test.txt
     
  4. planetcaravan

    planetcaravan New Member

    Hi and thanks for you answers.

    I've modified the script.

    Now I'm having on syslog:
    Code:
    May  4 00:16:01 vps01 /USR/SBIN/CRON[2697]: (web17) CMD (/var/www/mydomain.tld/backup/script.sh^I#mydomain.tld)
    May  4 00:16:01 vps01 /USR/SBIN/CRON[2690]: (CRON) error (grandchild #2697 failed with exit status 127)
    May  4 00:17:01 vps01 /USR/SBIN/CRON[2705]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
    
    
    
    I'm also having this in: /var/log/ispconfig/cron.log


    Code:
    PHP Warning:  mkdir(): File exists in /usr/local/ispconfig/server/plugins-available/cron_jailkit_plugin.inc.php on line 293
     
    Last edited: May 4, 2012
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    And the xcript is working when you execute it manually on the shell?
     
  6. planetcaravan

    planetcaravan New Member

    Yes it works!
     
  7. planetcaravan

    planetcaravan New Member

    Can somebody help me, please?
     

Share This Page