[mythtv] RE: [mythtv-users] tv_grab_na_dd backportdatato.14system?
Jim Bauer
jfbauer at comcast.net
Sun May 23 21:32:36 EDT 2004
On Sunday 23 May 2004 00:36, Matthew Mead wrote:
> OK, hopefully this is my last reply on this.
>
> 1. I setup a crontab -e and changed from this:
>
> ### Run mythfilldatabase every night at some random time after 2:30am
> 30 2 * * * sleep $(expr $RANDOM \% 7200) && mythfilldatabase >
> /var/log/mythtv/mythfilldatabase.log 2>&1
>
> To this:
>
> #!/bin/sh
> ##su mythtv -c "mythfilldatabase --quiet"
> 10 1 * * * su mythtv -c "/usr/local/bin/mythfilldatabasecron_dd"
>
> I then went to the /usr/local/bin directory, su to root, and created
> mythfilldatabasecron_dd
>
> I put this in it:
>
> #!/bin/sh
> #/usr/local/bin/mythfilldatabasecron_dd
>
> # temporary filename
> dirname='/tmp'
> filename="tv-${RANDOM}${RANDOM}"
> xml_file=${dirname}/${filename}.xml
>
> # From step 8
> sourceid=1
>
> # replace all data
> offset=-1
>
> # How many days worth of guide data to download
> numdays=10
>
> /usr/bin/tv_grab_na_dd --output ${xml_file} --days ${numdays} \
> --old-chan-id && \
> /usr/bin/mythfilldatabase --file ${sourceid} ${offset} ${xml_file}
>
> # Remove the temporary file
> rm ${xml_file}
>
> I then saved it and gave the following command to make it excutable:
>
> chmod +x mythfilldatabasecron_dd
>
>
> Does that look right? or do I need to adjust my cron job time or add a
> timer to the other two lines where I have #'s at?
Looks ok to me. The sleep was there so everyone that used that identical
entry wasn't hitting the server at the same time.
More information about the mythtv-users
mailing list