Cant get crontab to work, PLEASE HELP !!!

Discussion in 'Site & Server Administration' started by Alexj17, Feb 5, 2009.

  1. #1
    Hi All

    I have now spent the last 2 hours going through every result on google, using each code to try and get this to work.

    Bsically, i want every hour, to run a php file i have.

    What i have done,

    1) Created a (ssh).txt file
    7 14 * * * /home/fhlinux139/c/cabubble.co.uk/user/htdocs/email_test.php
    Code (markup):
    *This code has changed sooo many times to try and fix it.

    2) Logged in using putty
    3) used "crontab ssh.txt" command to run it.
    4) checked using -l that it has actually been picked up (which is has)
    5) waited and waited and waited for my php file to run, but it doesnt.

    aaaaaaaaaahhhhhhhhhhhhh

    Im sure if it is thecode in .txt file which is wrong, like i said, ive used sooo many different combinations ect to link to the php file, i have also change the time each time so i know that bit aint the problem.

    Please help
     
    Alexj17, Feb 5, 2009 IP
  2. sparek

    sparek Peon

    Messages:
    68
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The cron you have listed will run daily at 2:07PM server time. It won't run hourly.

    If you want it to run hourly at 7 past each hour then you need to use:

    7 * * * * /home/fhlinux139/c/cabubble.co.uk/user/htdocs/email_test.php
     
    sparek, Feb 5, 2009 IP
  3. gilmapaiyan

    gilmapaiyan Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try like this.. often u need to tell ur server who wanna run ur script.. here we want php interpretor to take over
     
    gilmapaiyan, Feb 5, 2009 IP
  4. Alexj17

    Alexj17 Member

    Messages:
    173
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #4
    Thanks for you help,

    The timer was just to test it for that time so make sure my path for the php was correct.
    After your replies and thinking about it, maybe the server time is different i dont know. I have now tried using just the minute time, and still now luck.

    I think the path to the php is the problem, i have tired the php -q option and still no luck.

    Any other ideas???
     
    Alexj17, Feb 5, 2009 IP
  5. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #5
    Try this

    7 14 * * * /usr/bin/wget -O - -q -t 1 http://www.yourdomain.com/path/to/email_test.php
    Code (markup):
    Kailash
     
    kailash, Feb 5, 2009 IP
  6. Alexj17

    Alexj17 Member

    Messages:
    173
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #6
    This still doesnt work, what is the usr/bin for?

    i have been told that my path for scripting is /home/fhlinux139/c/cabubble.co.uk/user/, i have tried both and still nothing.

    My php file is just code to send me an email,
     
    Alexj17, Feb 6, 2009 IP
  7. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #7
    /usr/bin is a directory on Linux server which contains all the Linux command. wget is one of the linux command through which you can execute PHP file. Not sure why it is not working for you. I suggest you to contact your host to check why it is not working.

    Kailash
     
    kailash, Feb 6, 2009 IP