Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Setting up cron job?

  • 27-07-2011 02: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, Registered Users 2 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, Registered Users 2 Posts: 3,141 ✭✭✭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, Registered Users 2 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