Running a cron job for DownloadMail Plugin

By Christopherb - July 30, 2010 - edited: July 30, 2010

We are having trouble running a cron job for the DownloadMail Plugin.

The path is
/home/www/jackson/cmsAdmin/plugins/downloadMail/run.php

When the cron runs, we get the following error:

PHP Warning: require_once(../../lib/init.php): failed to open stream: No such file or directory in /home/www/jackson/cmsAdmin/plugins/downloadMail/run.php on line 4
PHP Fatal error: require_once(): Failed opening required '../../lib/init.php' (include_path='.:') in /home/www/jackson/cmsAdmin/plugins/downloadMail/run.php on line 4

From within the cmsAdmin the script runs fine...

Re: [Christopherb] Running a cron job for DownloadMail Plugin

By Jason - August 2, 2010

Hi,

Even though it's producing an error, does it still download the emails?

If not, you can try to replace the path in run.php with the complete url to init.php, It would probably look something like this:

require_once("http://www.yourdomain.com/cmsAdmin/lib/init.php");

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Running a cron job for DownloadMail Plugin

Hi Jason,

Got it to work with the full path.

Changed:

../../lib/init.php

to

/home/www/jackson/cmsAdmin/cmsAdmin/lib/init.php

Hope this helps someone else too...

Thanks,

Chris

Re: [Christopherb] Running a cron job for DownloadMail Plugin

Hi, Folks -

I'm new to this plugin and encountered a similar problem as Chris.

I could only get the cron job to run by prefixing the path with:
/usr/bin/php -q
The final command line looked something like this....
/usr/bin/php -q /my/path/to/plugins/downloadMail/run.php

Hope this helps too!

:0)

Perch

Re: [Perchpole] Running a cron job for DownloadMail Plugin

By Dave - October 8, 2010

Thanks for sharing your solution! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Hybrid] Running a cron job for DownloadMail Plugin

By Dave - April 13, 2011

Hi Hybrid,

By default run.php won't work unless you disable the security check. We add this to a lot of our example pages so people aren't allowing code to run without knowing what it's for.

The solution is to edit run.php and remove the security check error. It looks like this:

die("Security Check - Edit run.php and remove this error before you use it.");

Just remove that line or put a comment # in front of it.

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Running a cron job for DownloadMail Plugin

Thanks Dave, that did it! lol Can't believe I missed it. You gotta love how fast the CMSB forums work :)