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


[PHP] Running Cron Jobs Via PHP Script





Rhysige
Ok heres the thing I want to know if it is possible to manually trigger a Cron job via a PHP script, not the other way around which is normal but I want a PHP script that can trigger a cron job. Is this possible if so how?
Grimboy
So you want to execute something from php, not sure what that has to do with cron jobs but anyway:

Exec, system or shell_exec. Those are most likely disabled on here.

If it's another php script then this:
ob_start();
include("./path/to/file.php");
ob_end_clean();

If it's anything else:
Place the script in a password protected directory and use CURL to execute it (CURL knows the password).

I'm in a bit of a colon mood.
Rhysige
No it needs to be via the cron job since it runs quite an array of things and when we update them there we dont wanna have to update scripts aswell. I know how I could execute a php via a php but that isnt what im asking.
Stubru Freak
Rhysige wrote:
No it needs to be via the cron job since it runs quite an array of things and when we update them there we dont wanna have to update scripts aswell. I know how I could execute a php via a php but that isnt what im asking.


You need shell access to the system. Then you must find the file(s) where the cron jobs are stored, but no idea what that is
Related topics
[RESOLVED] cron jobs
Cron Jobs
Cron jobs - running a php file
Executing automated tasks without using cron jobs
cron jobs?
Problems With Cron Jobs
Question: PHP scripting + cron jobs
using cron jobs and scp to automate backups
CRON Jobs
Cron jobs and PHP?
Cron jobs
cron jobs running early
Has anyone installed Moodle successfully?
Repetitive Events Without 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.