MyBB Community Forums

Full Version: Cron Job for Task
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It's what I needed, yes.

Peharps you don't use the good call to php, you might try to do:
which php-cli

I'm affraid that cgi-fcgi is the global response you get, calling php5 from url or console, and then your tasks will always work in cli mode (with the current modification).

EDIT : you can try the small hack above (with function is_cli())
Would you happen to know if there is a difference from running a task from the commandline as opposed to running it from cron.
Reason for asking is via command line - the task runs perfectly every single time

However when using it in a cron I can only get the task to run if I specify times in the 'minute' setting.
e.g. */5 * * * * /usr/bin/php5  myscript  id - works fine and runs every 5 minutes

however if I change it to a specfic time nothing happens. e.g if I needed it for 15:30hrs every day
30 15 * * * /usr/bin/php  myscript id


IGNORE ABOVE
Scrap my last message - have just realised that my server is located in Germany - a different timezone to me. (+1hr ahead) Rolleyes
In essence, I was setting the job to run using my local time - which was of course, to the server, had already passed !

/ I feel like a right douch ! Blush Blush
Pages: 1 2