Cron

Discussion in 'General' started by Oitsuki, Apr 5, 2019.

  1. Oitsuki

    Oitsuki Member

    Hello,

    I try to create a cron with the ispconfig backoffice.
    I made this
    Parent website : mysubdomain.com
    Minutes : 00
    Hours : 1
    Days of month : *
    Months : *
    Days of week : *
    Command to run (commands are executed via sh, urls via wget) : /var/www/mysubdomain.org/web/my_script_directory/script_db.sh
    log output : yes
    Active : yes
    my script : script.sh (chmod in 755)
    MAILTO="[email protected]" /usr/bin/mysql -e /usr/bin/mysql c1_myd_db < /var/www/my_subdomain.org/web/db_demo_client/c1_my_db_to_import.sql

    I look inside syslog : don't see the cron.
    Where is my mistake ?
     
    Last edited: Apr 5, 2019
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    look in /var/www/mysubdomain.org/private

    should have cron.log and cron_error.log in there.
     
  3. Oitsuki

    Oitsuki Member

    @nhybgtvfr
    No I have nothing inside this directory.
     
  4. Oitsuki

    Oitsuki Member

    I try to change this :/var/www/mysubdomain.org/web/my_script_directory/script_db.sh
    by this : /var/www/clients/client1/web8/web/db_demo_client/script_db.sh (script and ispconfig interface cron)
    always the same thing.
    Just a question : the cron must to work every hour, is it correct ?
    Tk
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    No, you set it to start at 1 am in the morning.
     
  6. Oitsuki

    Oitsuki Member

    Hello,
    I do not understand when I launch the scron via sh script_db.sh, it works well but with ispconfig, I have always this error

    Code:
    (web8) CMD (/web/db_demo_client/script_db.sh >>/private/cron.log 2>>/private/cron_error.log #xxxxxxxx.org)
    
     
  7. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    What error?

    The paths you show would be for a cron run in a jail, assuming the script is the same as above, do you have /usr/bin/mysql in your jail environment? Do you have it configured to not require a password for mysql inside the jail?

    Fwiw, I would not recommend storing your .sql files within your website document root, they would be more protected if kept under /private.
     

Share This Page