Crashes When Running from Cron Job

Andy Bircumshaw andy at
Mon Apr 23 11:02:34 EDT 2012

On 23 April 2012, at 12:51, ajebay wrote:
>> My efforts with running --pvr switch from cron job have had mixed success.  It appears that when the download fails part way through, the system locks up with get_iplayer still running but nothing happening.
> Latest example was from last night when Silent Witness failed.  I erased the partial file this morning and did a straight --get run which went fine (at max tariff!) but I cannot now run --pvr.  I get the following message:-
> ERROR: Quitting - process is already running (/home/alastair/.get_iplayer/pvr_lock)
> The lock file contains the number 24706.
>> Before I try and kill the process that is still running are there any logs which I should report here which would help?

Instead of deleting only the *partial file, you also need to kill the rtmpdump process.

If you run `lsof /path/to/downloads/*partial` you will see the PID of the rtmpdump process.

So execute `rm /path/to/downloads/*partial && kill $PID` (setting or replacing $PID as appropriate).

The --pvr job will receive an "unsuccessful" exit signal from the rtmpdump process and either start again from scratch or just continue to the next job (making another attempt to get this programme tomorrow). 

I think that get_iplayer could handle stuff like this better, but there's a reluctance to delve to deeply into the codebase (for reasons which have been discussed in the past).

As a consequence I check my download directory for *partial files on a daily basis. You could alternatively run `find` in a cronjob to alert you of *partial files more than X hours old. The current state of get_iplayer is, IMO, that you can't just "set it and forget it" completely without intervention. It just takes a minute or so each morning to scroll through the email from your cronjob and check that all files have downloaded successfully, but I think you really need to do that. 


More information about the get_iplayer mailing list