perl myscript.pl > output.log
I got some errors when "require"ing some files. I entered the absolute address "/home/mydir/myscript.pl" for the require command and it worked. The problem is now with GnuPG. I am calling a perl module:
use lib qw ( /home/mydir );
use mymodule;
which happens to be in the same directory as the perl script. This module calls GnuPG:
use GnuPG::Interface;
This module also contains a line:
my $gpg_dir = "/home/mydir/.gnupg"
to locate the gpg keys.
When the cron job is being executed i am getting an error:
exec() error: No such file or directory at /usr/local/lib/perl5/site_perl/5.8.6/GnuPG/Interface.pm line 323.
Interface.pm exists in that directory. I never touched that file. Why am i getting an error in this file only when running a cron job?
I hope this may address your problem -- I am not sure, though.
To run cron as root, just start with "crontab -e" under root login. This will get you a root crontab.
Regards,
R.