get_iplayer forums

Full Version: Cannot find Perl local lib from crontab
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
- operating system: Ubuntu 12.04
- get_iplayer version: 3.01 - manually installed following instructions in the wiki.
- problem: attempting to refresh cache from crontab produces the following error message:
Can't locate object method "name" via package "Mojo::UserAgent::Transactor" at /usr/local/bin/get_iplayer line 6771.

Here's the crontab entry:
15 * * * * /usr/local/bin/get_iplayer -v --type=radio --refresh > /home/alan/log-radio-gip.txt 2>&1
Output log is attached - it ends with the error message quoted above.

Running the identical command directly in the terminal runs properly and refreshes the cache without problem.

During installation I followed the wiki's instructions to create a local Perl module library at ~/perl5. I'm guessing that a command running from cron does not find this local library. How can I fix this?
Thanks,
Alan.


[attachment=240]
You would need to explicit load the relevant dot-file(s) in crontab, and perhaps explicitly set $SHELL. Google is your friend here. You could probably also simply add local lib to @INC directly: /usr/bin/perl -I$HOME/perl5/lib/perl5 /usr/local/bin/get_iplayer [...]
perl -I solves the problem. Thank you for get_iplayer.
Alan.