Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Setting up cron job?

Options
  • 27-07-2011 2:55am
    #1
    Closed Accounts Posts: 2,828 ✭✭✭


    I need to run a php script routinely, maybe once a week with cron I am on an apache setup with blacknight anyone have any idea how to set this up?


Comments

  • Registered Users Posts: 1,477 ✭✭✭azzeretti


    Open Source form might be better but do you have shell access? If you do just "crontab -e" to edit your crontab. ("export EDITOR=nano" first will set your editor to nano, change this to vi or whatever)
    You can then just add your cron information in the crontab.

    I am not sure about Blacknight or the package you are on but some hosted services supply Cpanel (or similar) and you should be able to create crons easier there via a GUI etc.


  • Registered Users Posts: 3,140 ✭✭✭ocallagh


    And just to add to the above - (if you are you logging in via ssh/putty) you also need to place your cron entry in the crontab for the user you want your process to run as - and in most cases the same user that runs apache.

    To find the user running apache:
    [PHP]ps aux | grep apache [/PHP]

    This will prob return apache or www-data or perhaps nobody - To edit cron for the user 'apache' you would do:
    [PHP]crontab -u apache -e[/PHP]

    To have an entry run every week you would place a new line in the crontab as follows:

    [PHP]0 0 * * 0 /path/to/php /path/to/script.php >> /path/to/output.txt[/PHP]


  • Closed Accounts Posts: 2,828 ✭✭✭Reamer Fanny


    This is what I have in the Blacknight control panel


  • Registered Users Posts: 40,038 ✭✭✭✭Sparks


    Ask Blacknight support justryan, they're pretty good at the tech support game.
    But as the charter says:
    Web Hosting
    1. Questions about specific web hosting companies or how to use their services aren't allowed.
    2. Looking for recommendations or suggestions for a web host are also prohibited.


This discussion has been closed.
Advertisement