[mythtv-users] Mythfilldatabase cron job fails

Paul Shepherd paul at whitelands.org.uk
Mon Dec 4 21:59:27 UTC 2006


> on cron... cron uses different enviorment variables than you get when you login
> via bash. You may have to do a
> set > /tmp/set.listings
> in your script to see what variables are set when cron runs. You may need to
> do a
> export USER=mythtv
> or something like that.
> getting a script to run from cron is not as easy as it sounds. ;)
> Also... why not set this up as a cron job for the mythtv user? why
> root and su - ?
> ... probably won't make a difference but why...
> jack
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> .

Thanks for your comments which helped me fix the problem:

1) I didn't understand the su command syntax, thought it was running as 
mythtv - the following works for me:

su mythtv -c "mythfilldatabase --no-delete" > 
/var/log/mythtv/mythfilldatabase.log 2>&1

2) also the mythtv account was disabled - I had to allow login on the 
account to get it to work

3) think I had to change the permissions on the directory 
/var/log/mythtv as well to create the log file

I often find it unclear whether program installs etc should be done as 
root or not - all part of the linux learning curve.


More information about the mythtv-users mailing list