These forums are archived

See this post for further info

get_iplayer forums

Forum archived. Posting disabled.

Errors when running in Cron

user-1220

Hello,

When logged in as my user a linux machine, I am able to run get_iplayer without issue.

When the job triggers from cron, I get a couple of failures. The cron job is setup to run under the same user as I would run it manually.

Running under cron I get:


Code:
mkdir //.get_iplayer: Permission denied at /home/||myuser||/get_iplayer line 439

I commented out that line in the get_iplayer executable, but it just fails a few lines further down:


Code:
ERROR: Cannot write to lockfile '//.get_iplayer/pvr_lock'


the cron lines looks like this:

2  *  *  *  * ||myuser|| get_iplayer -f

3  *  *  *  * ||myuser|| get_iplayer --pvr

Any idea what might cause this? I'm sure the user name is right in cron but I can't explain this error. Why does it show the two //? The .get_iplayer folder in my user folder is owned by my user, as are all the files contained within. When I run the command as the user, it creates the lock file without issue...

Thanks!

user-2

Create a user-specific crontab instead of trying to use the system crontab, which is what it appears you are doing. You're getting the cron environment for root, which isn't going to work for you, as you can see. Also, you may want to allow more than 1 minute between cache refresh and pvr launch, just to be safe.

user-1220

You were totally right user-2. The surprising thing, however, is that I've been running the same commands from my system cron, under my username, on a different box for months and months without issue. I litterally rsync'd my config to the new machine, once I confirmed get_iplayer was working, and couldn't figure out the source of the issue.

Also, for the record, I don't actually run get_iplayer directly from cron. I instead have a couple of scripts that run, preventing two processes at the same time, managing the resulting files, etc.. I did test the above config, a very simplified version of what I run, so I could make a more concise post without having to add the complexity of my automation.

Thanks again for your help; I appreciate it! Everything is ticking along smoothly again.

These forums are archived

See this post for further info