These forums are archived

See this post for further info

get_iplayer forums

Forum archived. Posting disabled.

Problems running cron task

user-132

Hi,

I'm using get_iplayer on my RPi. I've a bunch of pvr searches set up and it works absolutely fine:

Code:
root@infinity:/home/get_iplayer# /home/get_iplayer/get_iplayer --pvr --profile-dir /root/.get_iplayer
get_iplayer v2.84, Copyright (C) 2008-2010 Phil Lewis
  This program comes with ABSOLUTELY NO WARRANTY; for details use --warranty.
  This is free software, and you are welcome to redistribute it under certain
  conditions; use --conditions for details.

Running PVR Searches:
_Nina_and_the_Neurons_name_tv
Matches:
1887:   Nina and the Neurons - Earth Explorers: 2. Grand Canyon, CBeebies, Children's,Entertainment & Comedy,Learning,Pre-School,TV, default

INFO: 1 Matching Programmes
INFO: Checking existence of default version
INFO: flashhigh1,flashhigh2,flashstd1,flashstd2 modes will be tried for version default
INFO: Trying flashhigh1 mode to record tv: Nina and the Neurons - Earth Explorers: 2. Grand Canyon
INFO: File name prefix = 2_-_Nina_and_the_Neurons_-_Earth_Explorers_Grand_Canyon                
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: 0.000 kB



However ...

If I run the same command as a cron job, it fails as it seems not to be able to find rtmpdump:

Cron: 10 * * * * /home/get_iplayer/get_iplayer --pvr --profile-dir /root/.get_iplayer >> /tmp/get_iplayer.log

Code:
get_iplayer v2.84, Copyright (C) 2008-2010 Phil Lewis
  This program comes with ABSOLUTELY NO WARRANTY; for details use --warranty.
  This is free software, and you are welcome to redistribute it under certain
  conditions; use --conditions for details.

Running PVR Searches:
_Nina_and_the_Neurons_name_tv
INFO: Getting tv Index Feeds
..............................................................................
Added: 19:      6 Music Live at Maida Vale - October 2013: 3. Paul McCartney - 6 Music Live at Maida Vale Highlights, Highlights, Classic Pop & Rock,Music,TV, default
Added: 132:     Arthur: Series 6 - 9. Just Desserts/The Big Dig, CBBC, Animation,Children's,Entertainment & Comedy,TV, default
Added: 635:     Bob the Builder: Project Build It: Series 6 - 2. Bob's Big Idea, CBeebies, Animation,Children's,Entertainment & Comedy,TV, default
Added: 1281:    Horrible Histories: Series 3 - Episode 8, CBBC, Audio Described,Children's,Entertainment & Comedy,Factual,TV, default,audiodescribed
Added: 1315:    House of Lords - Care Bill, BBC Parliament, Factual,News,Politics,TV, default,
Added: 1500:    Little Robots: Series 4 - 8. Noisy Knows Noise, CBeebies, Animation,Children's,Entertainment & Comedy,TV, default
Added: 1937:    Octonauts: Series 1 - 21. The Giant Whirlpool, CBeebies, Animation,Audio Described,Children's,Entertainment & Comedy,Learning,Pre-School,TV, default,audiodescribed
Added: 2102:    Postman Pat: Special Delivery Service: Series 1 - 9. Precious Eggs, CBeebies, Animation,Children's,Entertainment & Comedy,TV, default
Added: 2140:    Q Pootle 5 - 19. The Biggest Picture Ever, CBeebies, Animation,Children's,Entertainment & Comedy,TV, default
Matches:
1887:   Nina and the Neurons - Earth Explorers: 2. Grand Canyon, CBeebies, Children's,Entertainment & Comedy,Learning,Pre-School,TV, default

INFO: 1 Matching Programmes
INFO: Checking existence of default version
INFO: flashhigh1,flashhigh2,flashstd1,flashstd2 modes will be tried for version default
INFO: Trying flashhigh1 mode to record tv: Nina and the Neurons - Earth Explorers: 2. Grand Canyon
WARNING: Required rtmpdump does not exist - cannot download Flash audio/video
INFO: skipping flashhigh1 mode
INFO: Trying flashhigh2 mode to record tv: Nina and the Neurons - Earth Explorers: 2. Grand Canyon
WARNING: Required rtmpdump does not exist - cannot download Flash audio/video
INFO: skipping flashhigh2 mode
INFO: Trying flashstd1 mode to record tv: Nina and the Neurons - Earth Explorers: 2. Grand Canyon
WARNING: Required rtmpdump does not exist - cannot download Flash audio/video
INFO: skipping flashstd1 mode
INFO: Trying flashstd2 mode to record tv: Nina and the Neurons - Earth Explorers: 2. Grand Canyon
WARNING: Required rtmpdump does not exist - cannot download Flash audio/video
INFO: skipping flashstd2 mode
ERROR: Failed to record 'Nina and the Neurons - Earth Explorers: 2. Grand Canyon (b03bv10p)'
Alphablocks_name_tv



Any help would be much appreciated!

user-2

You don't say where you installed rtmpdump, but wherever it is, it isn't in PATH as defined in the cron environment. cron only gives you a minimal environment by default, and it doesn't access your .profile or similar configuration files. However, you can google up many ways to alter the cron environment. The alternative is to use the
Code:
--rtmpdump
,
Code:
--ffmpeg
, etc. options for get_iplayer to explicitly define where all the external utilities reside, but that's a bit tedious.

user-132

Thanks for the tips, you're absolutely right.

Followed the instructions from here: http://stackoverflow.com/questions/23880...rect-paths

Code:
# echo PATH=$PATH > tmp.cron
# echo >> tmp.cron
# crontab -l >> tmp.cron
# crontab tmp.cron



Works perfectly from cron now - thank you.

user-2

Thanks for posting that info - I'm sure others will run into the same problem.

user-1113

For some reason, I was unable to set PATH within my user crontab on Slackware 14.1.

An alternative solution which worked for me was to spawn a bash login shell from which to launch get_iplayer; this way bash will use whatever PATH you have set up in your various bash profile files (.bashrc etc).

You can do this with a line in crontab that looks something like:


Code:
0 * * * * bash -lc '/usr/local/bin/get_iplayer --pvr'


More info here: http://unix.stackexchange.com/questions/...h-variable

These forums are archived

See this post for further info