Forum Moderators: bakedjake

Message Too Old, No Replies

Setting Up Cron To Interface with CMS login

CRON Script and CMS Login

         

wolfcreek

7:11 pm on Jun 20, 2006 (gmt 0)

10+ Year Member



I utilize FreeBSD and PHP, I also use Joomla CMS as a backbone for the site. I have a script that I'd like to run for the site, but I have to be logged into the CMS to do it. I'd like to create a CRON Tab that executes the file, but cannot seem to find out how to execute the file after a login through the CMS Database. Any suggestions here?

The CRON I have is:

***** /usr/local/bin/lynx -source [mysite.com...] >&/dev/null

Thanks guys/girls

jamie

12:39 pm on Jul 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi wolfcreek,

if you have php installed as a binary (which all current versions of php should have - type "which php" from the command line to find the location) then you can call you script from cron using the php binary:

20 * * * /usr/bin/php /path/to/your_script.php > /dev/null

at the top of your script you have a simply db query which checks whether you are logged in and if you are, executes the actions you need, otherwise exits silently.

have i understood correctly?