get_iplayer forums

Cannot find Perl local lib from crontab - Printable Version

+- get_iplayer forums (https://forums.squarepenguin.co.uk)
+-- Forum: Linux & Unix Forums (https://forums.squarepenguin.co.uk/forum-10.html)
+--- Forum: Linux & Unix Troubleshooting (https://forums.squarepenguin.co.uk/forum-14.html)
+---- Thread: Cannot find Perl local lib from crontab (https://forums.squarepenguin.co.uk/thread-1440.html)



Cannot find Perl local lib from crontab - az_49 - 22-06-2017

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


RE: Cannot refresh cache from crontab - dinky - 22-06-2017

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


RE: Cannot find Perl local lib from crontab - az_49 - 23-06-2017

perl -I solves the problem. Thank you for get_iplayer.
Alan.