[mythtv-users] mythfilldatabase tip - random start time
David Rees
drees at greenhydrant.com
Mon Feb 9 14:55:44 EST 2004
Here's a tip for all you guys running mythfilldatabase from cron (which I
assume is nearly everyone!). I imagine that the majority of people use
3am or 4am as the start time to run mythfilldatabase. With hundreds of us
running mythfilldatabase at the same time, it wouldn't take much to
slasdot the information feed servers. I know that zap2it's servers get
pretty slow sometimes.
It's easy to randomize the start time, here's what I use in my crontab:
0 3 * * * sleep $(expr $RANDOM \% 7200) && \
mythfilldatabase > /var/log/mythtv/mythfilldatabase.log 2>&1
Now before running it will sleep a random amount of time between 0 and
7200 seconds before running mythfilldatabase. Might not be a bad idea to
increase the range to 10000 seconds, but I figure some randomization is
better than none.
Notice I also redirect the output from mythfilldatabase to a log file,
make sure that the file is writable by the user you're running
mythfilldatabase as. This can be handy in case you need to troubleshoot
any problems running mythfilldatabase.
Hope this is useful, I would like to see these tips added to any HOW-TOs
out there.
-Dave
More information about the mythtv-users
mailing list