Need help with simple CRON and Unix command

Discussion in 'Programming' started by BRUm, Mar 10, 2007.

  1. #1
    Hi,

    I've had complaints on my website that various variables, which rely on CRON to update by running x.php every hour, isn't working. It seems that CRON runs and sends me an email every hour to confirm, but it doesn't seem to be executing the script every time. Instead, it does it randomly.

    Here's my current CRON Job setup in Cpanel:

    [​IMG]

    I have no idea why it doesn't work right. Is this 'wget' command not as useful as others? If anyone can help I'd greatly appreciate it.

    Thanks,

    Lee.
     
    BRUm, Mar 10, 2007 IP
  2. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use 'curl' instead of 'wget' and try again :)
     
    tanfwc, Mar 10, 2007 IP
  3. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #3
    OK! Will try, thanks.
     
    BRUm, Mar 10, 2007 IP
  4. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #4
    Hmmm I don't think it worked. However I saw this on a website:

    What does the '--delete-after' do?

    Also, I get an error via email saying: "Couldn't resolve www.civ-online.com" when I use curl :/
     
    BRUm, Mar 10, 2007 IP
  5. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Strange, you need to contact your webhost and ask them what is the best option to call a remote site script. That's because your host might have disable wget, curl. Last function you can try to use is 'lynx'

    Good luck!
     
    tanfwc, Mar 10, 2007 IP
  6. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Perhaps the wget is timing out. I solved a cron problem by simply using the full path to php to run a script on my server, as in:

    /usr/local/bin/php /home/MYWEBPATH/x.php

    I also got it to work with lynx instead of wget:

    lynx -dump http://MYDOMAIN/x.php
     
    clancey, Mar 10, 2007 IP
  7. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #7
    Thanks a lot friends. I fixed the problem. It appears the script was not being executed, rather it was being told to output.

    Here is how I solved it:

     
    BRUm, Mar 11, 2007 IP
  8. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Man, i thought it was a remote script you are trying to called. :)
     
    tanfwc, Mar 11, 2007 IP
  9. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #9
    Yeah I was trying remote 'cause it would be easier. But I gave in and tried it internally.
     
    BRUm, Mar 11, 2007 IP