Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Running a cron job for DownloadMail Plugin

 

 


Christopherb
User

Jul 30, 2010, 11:48 AM

Post #1 of 8 (2125 views)
Shortcut
Running a cron job for DownloadMail Plugin Can't Post

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...


(This post was edited by Christopherb on Jul 30, 2010, 11:49 AM)


Jason
Staff / Moderator


Aug 2, 2010, 9:01 AM

Post #2 of 8 (2007 views)
Shortcut
Re: [Christopherb] Running a cron job for DownloadMail Plugin [In reply to] Can't Post

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:


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


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

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


Christopherb
User

Aug 2, 2010, 10:46 AM

Post #3 of 8 (2001 views)
Shortcut
Re: [Jason] Running a cron job for DownloadMail Plugin [In reply to] Can't Post

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


Perchpole
User

Oct 8, 2010, 8:15 AM

Post #4 of 8 (1293 views)
Shortcut
Re: [Christopherb] Running a cron job for DownloadMail Plugin [In reply to] Can't Post

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:

Code
/usr/bin/php -q

The final command line looked something like this....

Code
/usr/bin/php -q /my/path/to/plugins/downloadMail/run.php


Hope this helps too!

:0)

Perch


Dave
Staff / Moderator


Oct 8, 2010, 11:05 AM

Post #5 of 8 (1285 views)
Shortcut
Re: [Perchpole] Running a cron job for DownloadMail Plugin [In reply to] Can't Post

Thanks for sharing your solution! :)

Dave Edis - Senior Developer
interactivetools.com
 


Hybrid
User

Apr 13, 2011, 7:45 PM

Post #6 of 8 (841 views)
Shortcut
Re: [Dave] Running a cron job for DownloadMail Plugin [In reply to] Can't Post

So I have some questions about this plugin, I have the archiving function working fine and I have the incoming mail displaying correctly in the section. However I'm thinking I missed something because it doesn't pull mail automatically, every time I want new mail I have to click the plugin download mail button. I tried using a cron job to run this but it's not updating, if I set the cron to email it works but doesn't display any information it tells me: Security Check - Edit run.php and remove this error before you use it. In the body of the email. The cron script I'm running is this:

/usr/bin/php -q /home/shaftsan/public_html/admin/plugins/downloadMail/run.php

I also updated the run.php to use the absolute URL and it still doesn't work.

Any insight would be awesome


Dave
Staff / Moderator


Apr 13, 2011, 8:30 PM

Post #7 of 8 (840 views)
Shortcut
Re: [Hybrid] Running a cron job for DownloadMail Plugin [In reply to] Can't Post

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:


Code
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
 


Hybrid
User

Apr 13, 2011, 8:38 PM

Post #8 of 8 (839 views)
Shortcut
Re: [Dave] Running a cron job for DownloadMail Plugin [In reply to] Can't Post

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