| View previous topic :: View next topic |
| Author |
Message |
Bianca
Joined: 08 May 2009 Posts: 1
|
Posted: May 08, 2009 8:16 pm Post subject: Cron job problem |
|
|
Hello,
I'm having a problem with cpanel cron job, I'm getting this error message:
Can't locate ./messages.cfg in @INC (@INC contains: /home/sergio/public_html/cgi-bin/communimail/clibs/CSV /home/sergio/public_html/cgi-bin/communimail/libs /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/sergio/public_html/cgi-bin/communimail/cmaild.pl line 14.
How can I fix this? I'm having a several problem with this script and I just installed it today!
Thanks a lot. |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1127
|
Posted: May 11, 2009 7:10 am Post subject: Re: Cron job problem |
|
|
Hello,
most likely you didnt included "cd /path/to/communimail" into your cron (as shown in install manual). What is your _exact_ cron command?
Thanks
| Bianca wrote: | Hello,
I'm having a problem with cpanel cron job, I'm getting this error message:
Can't locate ./messages.cfg in @INC (@INC contains: /home/sergio/public_html/cgi-bin/communimail/clibs/CSV /home/sergio/public_html/cgi-bin/communimail/libs /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/sergio/public_html/cgi-bin/communimail/cmaild.pl line 14.
How can I fix this? I'm having a several problem with this script and I just installed it today!
Thanks a lot. |
|
|
| Back to top |
|
 |
madhosting
Joined: 30 Jun 2009 Posts: 8
|
Posted: Jun 30, 2009 9:00 pm Post subject: |
|
|
I have very similar errors.
Can't locate libraries.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thr!
ead-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /home/sites/madnewsletters.com/public_html/madnewsletter/cmaild.pl line 5.
BEGIN failed--compilation aborted at /home/sites/madnewsletters.com/public_html/madnewsletter/cmaild.pl line 5.
The hosting I use has a front end for cron jobs that you just enter the full path to the file with the interpretor in front i.e. /usr/bin/perl /home/sites/madnewsletters.com/public_html/madnewsletter/cmaild.pl
I have tried to correct the errors by putting the full path the the required files in the script such as the absolute path to libraries.pm got rid of the first error and just failed with the next file that could not be found. by putting the full path infront of all the file calls I have got rid of all the errors above but I now cant get rid of the following error
Content-type: text/html
<HTML>
<HEAD>
<TITLE>Error !</TITLE>
</HEAD>
<BODY> <H1>Software error:</H1>
<CODE>Cannot open config file</CODE>
<P>
For help, please send mail to the webmaster (<a href="mailto:"></a>),
giving this error message
and the time and date of the error.
</BODY>
</HTML> |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1127
|
Posted: Jul 01, 2009 10:55 am Post subject: |
|
|
You should just do a "cd" command and only then execute script.
If you will just provide full path to the script - that will bring you error that something is not found. |
|
| Back to top |
|
 |
madhosting
Joined: 30 Jun 2009 Posts: 8
|
Posted: Jul 01, 2009 12:42 pm Post subject: |
|
|
Tried that, the error returned is then
Can't open perl script "cd": No such file or directory
/bin/sh: ./cmaild.pl: No such file or directory |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1127
|
Posted: Jul 01, 2009 12:44 pm Post subject: |
|
|
| madhosting wrote: | Tried that, the error returned is then
Can't open perl script "cd": No such file or directory
/bin/sh: ./cmaild.pl: No such file or directory |
What is your cron job command? Provide entire command string. |
|
| Back to top |
|
 |
madhosting
Joined: 30 Jun 2009 Posts: 8
|
Posted: Jul 01, 2009 12:51 pm Post subject: |
|
|
The hosting I use has a "nice" front end to cron and so you don't add the command exactly as a normal cron commanrd.
The help information for the scheduled task setup is as follows
Scheduled tasks allows you to enable programs to run automatically on the server at specific intervals. Please note that each account can only run 3 scheduled tasks.
Configure Scheduled Tasks
The command lines below will be run on the web server for you at the intervals you select. Please note that the path is absolute so if your script is called test.pl and is located in your public_html/ directory then the full path would be:-
/home/sites/madnewsletters.com/public_html/test.pl.
Programs that use excessive server resources may be banned. We take this opportunity to remind you that we do not allow permanent server processes to be run on our servers.
Common Problems
Please note the following common problems you may experience when setting up a scheduled task:
•Please make sure you enter a valid date for your tasks.
•The file permissions for the script are set correctly, 711 or 755.
•If the scheduled program includes code from a scripting language, the path for the interpreter must be specified before the script. For example, /usr/bin/perl (Perl), /usr/bin/php (PHP 4) or /usr/bin/php5 (PHP 5)
•If the script being run is adapted from a CGI script, ensure the first line of the script is a 'shebang' line containing the correct interpreter path - as above - (for example #!/usr/bin/perl).
The command I entered originally that caused the error where files could not be found is
/usr/bin/perl /home/sites/madnewsletters.com/public_html/madnewsletter/cmaild.pl
The second command that caused the error Can't open perl script "cd": No such file or directory /bin/sh: ./cmaild.pl: No such file or directory
is
/usr/bin/perl cd /home/sites/madnewsletters.com/public_html/madnewsletter; ./cmaild.pl
There are then seperate drop down boxes to set how often the command runs.
Thanks
Richard |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1127
|
Posted: Jul 01, 2009 12:54 pm Post subject: |
|
|
As per manual, line should be:
cd /home/sites/madnewsletters.com/public_html/madnewsletter; perl cmaild.pl
assuming that path /home/sites/madnewsletters.com/public_html/madnewsletter is correct and cmaild.pl located there. |
|
| Back to top |
|
 |
madhosting
Joined: 30 Jun 2009 Posts: 8
|
Posted: Jul 01, 2009 3:39 pm Post subject: |
|
|
That gives the following error
nice: cd: No such file or directory
Can't open perl script "cmaild.pl": No such file or directory |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1127
|
Posted: Jul 02, 2009 5:35 am Post subject: |
|
|
| madhosting wrote: | That gives the following error
nice: cd: No such file or directory
Can't open perl script "cmaild.pl": No such file or directory |
Then, path you provided is not correct. |
|
| Back to top |
|
 |
madhosting
Joined: 30 Jun 2009 Posts: 8
|
Posted: Jul 02, 2009 9:46 am Post subject: |
|
|
The path is correct and the command
/usr/bin/perl /home/sites/madnewsletters.com/public_html/madnewsletter/cmaild.pl
finds cmaild.pl but then can't find libraries.pm as per the original error |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1127
|
Posted: Jul 02, 2009 9:50 am Post subject: |
|
|
This is very strange:
| Quote: | | cd: No such file or directory |
Try to put single line to cron in order to test:
cd /home/sites/madnewsletters.com/public_html/madnewsletter/
Actually, problem that it cant find libraries.pm because it didnt completed "cd" into that dir. |
|
| Back to top |
|
 |
madhosting
Joined: 30 Jun 2009 Posts: 8
|
Posted: Jul 02, 2009 10:05 am Post subject: |
|
|
that gives the following error
nice: cd: No such file or directory
So it is not accepting cd: as a valid command to change the directory, is it looking for a dirrectory or file called cd? |
|
| Back to top |
|
 |
madhosting
Joined: 30 Jun 2009 Posts: 8
|
Posted: Jul 02, 2009 10:20 am Post subject: |
|
|
accoring to my hosting support CD cannot be used.
Quote from support:-
"It simply means that the script isn't able to access those files through relative links, please change them all to full addresses to the files, and it should work fine then hopefully.
I have no problem modifying the files to put the full paths in but I might need some help working out where all the file calls are that I will need to modify |
|
| Back to top |
|
 |
admin Site Admin

Joined: 22 Mar 2006 Posts: 1127
|
Posted: Jul 02, 2009 10:39 am Post subject: |
|
|
in cmaild.pl add following lines right after "use strict;" line:
use lib '/home/sites/madnewsletters.com/public_html/madnewsletter';
chdir('/home/sites/madnewsletters.com/public_html/madnewsletter'); |
|
| Back to top |
|
 |
|