FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


CRON Jobs





moejoe
Hi,

Im new to CRON jobs.

Does anyone know how to execute a PHP script via CRON on a VDECK control panel


Thanks!
kv
just put this line at the top of your php script

Code:

#!/usr/bin/php   
//(or the php executable path, if it is installed in other directory)


Then set your php file in the cron job as you would any other shell script. You man also have to add the execute permission to your php script.

Alternatively, you may write a shell script and run your php file from it

Code:

#!/usr/bin/sh

php <path to your php script>



and set the shell script as cron job
moejoe
ohk.

Thanks.

Could you give me an example of a script.
I googled it and found some scripts that run with the format:

Code:
10 * * * * home/domain/etc/etc.php

Could you please explain what this means.

Also.
Because Vdeck Sucks and you can only do one job at a time, how can i tackle this?

Should i put all my maintenance scripting in one php file?

Thanks.
kv
Quote:
10 * * * * home/domain/etc/etc.php


This is a standard unix format for setting cron job. You can get more information about it here http://docs.phplist.com/SetupCronJob. I haven't used vdesk, so I am not sure how to set it up. If it does not allow you to set more than one script, just have a parent script which just calls other scripts (if it is a shell script, you can call other scripts in background mode so that all of them run in parallel).
Related topics
Cron Jobs
propos des cron jobs
[RESOLVED] cron jobs
Cron jobs
I don't have cron jobs enabled ?
cron jobs
Cron Jobs
Cron Jobs
Cron Jobs
Cron jobs - running a php file
Executing automated tasks without using cron jobs
cron jobs?
Problems With Cron Jobs
Enabling Cron Jobs
how do I auto backup using cron jobs
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.