Cron Jobs not working [resolved]

Discussion in 'General' started by mircot80, Feb 24, 2024.

Tags:
  1. mircot80

    mircot80 New Member

    Hi everyone.
    ISPConfig 3.2.11p2 , Debian 12 e Apache
    I can't get Cron Jobs to work.
    If I open this link from a browser http://inmob.it/module/gsitemap/cron?token=ec5036ea3a&id_shop=1 it works and creates the sitemap files.
    If I insert the link into a Cron Jobs it doesn't seem to run.
    I created the Cron Job as a non-admin user.
    What should I check?


    Code:
    cat /etc/cron.d/ispc_web1
    MAILTO=''
    SHELL='/bin/sh'
    
    *       *       *       *       *       web1    /usr/bin/wget --no-check-certificate --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' -q -t 1 -T 7200 -O /var/www/clients/client1/web1/private/cron_wget.log 'http://inmob.it/module/gsitemap/cron?token=ec5036ea3a&id_shop=1' >>/var/www/clients/client1/web1/private/cron.log 2>>/var/www/clients/client1/web1/private/cron_error.log #inmob.it
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The cron file you posted is fine, so the cronjob has been correctly created. The cronjob requests the URL you mentioned once a minute using wget. So you should see this in access.log file once a minute, search for it with grep:

    Code:
    cd /var/www/clients/client1/web1/log
    grep ec5036ea3a access.log
    you can also try to run the command manually:

    Code:
    /usr/bin/wget --no-check-certificate --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' -q -t 1 -T 7200 -O /var/www/clients/client1/web1/private/cron_wget.log 'http://inmob.it/module/gsitemap/cron?token=ec5036ea3a&id_shop=1'
     
    mircot80 likes this.
  3. mircot80

    mircot80 New Member

    I think my problem is that with NAT it can't connect to itself via public IP
     
  4. mircot80

    mircot80 New Member

    in fact I added the internal IP to the /etc/hosts file and that's it works.
    I don't know if this can create other problems...
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    That should be ok.
     

Share This Page