The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Issue with Cron

Discussion in 'General Discussion' started by Lupiyardo Poomiha, Jun 12, 2015.

  1. Lupiyardo Poomiha

    Joined:
    Jun 12, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    Website Owner
    Hello everyone, I'm trying to setup a crontab to ping a Cron module I'm using on my Drupal site hosted on a shared Bluehost account.

    I've set the cron module in Drupal to update certain things every 15 minutes and others just once per day.

    So my understanding is I need to set my cPanel cron to run every minute so it knows to run the 15 minute interval update when it arrives.

    So I've added the following command to my cPanel cron:

    wget sitename.com/staging/sites/all/modules/elysia_cron/cron.php > /dev/null

    And of course I get emails every minute from this. But here's what the email says:

    Code:
    —2015-06-1203:46:01-- http://www.sitename.com/staging/sites/all/modules/elysia_cron/cron.php
    Resolving www.sitename.com... 104.28.4.111, 104.28.5.111, 2400:cb00:2048:1::681c:56f, ...
    Connecting to www.sitename.com|104.28.4.111|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location:http://sitename.com/staging/sites/all/modules/elysia_cron/cron.php[following]--2015-06-1203:46:01-- http://sitename.com/staging/sites/all/modules/elysia_cron/cron.php
    Resolving sitename.com... 66.147.244.203
    Connecting to sitename.com|66.147.244.203|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location:http://www.sitename.com/sites/all/modules/elysia_cron/cron.php[following]--2015-06-1203:46:01-- http://www.sitename.com/sites/all/modules/elysia_cron/cron.php
    Connecting to www.sitename.com|104.28.4.111|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden2015-06-12 03:46:02ERROR 403: Forbidden.
    
    Anyone know why this might be happening?
     
    #1 Lupiyardo Poomiha, Jun 12, 2015
    Last edited by a moderator: Jun 12, 2015
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    use the lynx command instead wget and see what happens
     
  3. Lupiyardo Poomiha

    Joined:
    Jun 12, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    Website Owner
    hmmm that doesn't seem to do anything.

    also, I forgot to mention (not sure this matters)...but this site is a sub-domain of mysite so it's technically hosted at staging.mysite.com but the directory structure is as I have it in my cron command: mysite/staging/etc.
     
  4. Lupiyardo Poomiha

    Joined:
    Jun 12, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    Website Owner
    Ok, so I got this when I replaced wget with curl:

    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed

    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
    100 9425 0 9425 0 0 11628 0 --:--:-- --:--:-- --:--:-- 12006

    I assume that means it's running correctly?
     
  5. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    Looks like that would have been may next suggestion "curl"
     
  6. Lupiyardo Poomiha

    Joined:
    Jun 12, 2015
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    Website Owner
    Yea, it's working now. Thanks for your help; your suggestion got me looking in the right place. Basically I replaced wget with curl and since this is a subdomain I put the url of the subdomain and the path to the elysia cron php file like so http://subdomain/sitename/sites/sitepathtoelysiacron.php?cron_key=longkey /dev/null 2>&1

    This worked for me on bluehost.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page