Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Cron Setup

  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts

    Cron Setup

    Hi guys,

    Already read through most of the old cron posts but I am still having problems making my Cron run.

    I am using CPanel to run the script and am testing at 5 minute intervals every hour.

    After some googling I have noticed that some posters are using wget rather than php.

    Can someone please tell me if i am doing something wrong and if so what I can do to fix this:

    /usr/bin/wget -q -t 5 /home/MYSITE/scripts/email.php

    email.php just emails me to say that the job has run.

    Any help appreciated

    D.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com

  • #2
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts
    the cronjob must have the following format:
    Code:
    TERM="xterm"; /usr/bin/lynx -dump http://my-best-domain.com/cron.php
    So you just need to put TERM="xterm"; /usr/bin/lynx -dump before the path of the script.

    if you are still having trouble just open a new ticket with your web hose and Im sure they will get it working for you.

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    Did you run your script from a browser manually to make sure it works? That's the first step. Once you know its working that way then you can try running it as a cron job.

    Two things to check:

    1. Make sure you have #!/usr/bin/php at the top of your cron job.

    2. Make sure your script has 755 permissions.
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts
    I got it to work using the following:

    wget -q http://site_name/scripts/test_cron.php

    But If I want to put it in my CMS which has .htpasswd restriction can I place the username and password in the crontab using --user and --password or do I do it some other way?

    D.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •