[mythtv] RE: [mythtv-users] tv_grab_na_dd backportdatato.14system?

Matthew Mead mkmead at hoodnet.net
Sun May 23 23:31:51 EDT 2004


Can I reuse part of the old command to randomize it a bit more?
----- Original Message ----- 
From: "Jim Bauer" <jfbauer at comcast.net>
To: <mythtv-users at mythtv.org>
Sent: Sunday, May 23, 2004 9:32 PM
Subject: Re: [mythtv] RE: [mythtv-users] tv_grab_na_dd
backportdatato.14system?


> 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.
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
>




More information about the mythtv-users mailing list