develooper Front page | perl.beginners | Postings from February 2012

Re: Module error

Thread Previous
From:
John SJ Anderson
Date:
February 15, 2012 10:21
Subject:
Re: Module error
Message ID:
61582EE3D1334C1D8D4602B8F63D9550@genehack.org
> I am running my perl script and using some perl modules like below :-
> 
> use File::Path qw(mkpath);
> use File::Rsync;
> my $rsync = '/opt/zimbra/rsync/bin/rsync';
> 
> 
> when I run the script using 
> perl scriptname --> then it runs fine, however when I run through crontab, it get this error : -
> 
> Can't locate File/Rsync.pm in @INC (@INC contains:/etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /opt/zimbra/lbin/backup.pl (http://backup.pl) line 8.
> 
> Any clues ?
> 
> 
> 


Most likely, the perl binary you're using is not the same one your cron is using.

Do 'which perl' in your shell, and then use the full path to that binary in your cron entry, and see if that doesn't fix it.

If it doesn't, then there's some other aspect of your interactive environment (PERL5LIB, etc.) that isn't set in the crontab environment.

chrs,
john.



Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About