[mythtv] RE: [mythtv-users] tv_grab_na_dd backportdatato.14system?
Matthew Mead
mkmead at hoodnet.net
Sun May 23 00:36:42 EDT 2004
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?
Thanks for your help.
----- Original Message -----
From: "Jim Bauer" <jfbauer at comcast.net>
To: <mythtv-users at mythtv.org>
Sent: Saturday, May 22, 2004 10:06 PM
Subject: Re: [mythtv] RE: [mythtv-users] tv_grab_na_dd
backportdatato.14system?
> On Saturday 22 May 2004 20:17, Matthew Mead wrote:
>
> >
> > OK, this makes sense. The Problem is what should the script entry be?
> > because the one I thought I was supposed to use doesn't work (see error
> > message above). This was what I had entered into my crontab -e
> >
> > #!/bin/sh
> > #/usr/local/bin/mythfilldatabasecron_dd
> >
> > # temporary filename
> </snip>
> >
> > Is that the wrong script? Whats the right one I should be using?
>
> When you edit/create those kinds of crontab files, each line has a
> special format the describes what command to run and when to run it.
> See "man 5 crontab" for details. But here is an example.
>
> 10 4 * * * some_command
>
> It says to run "some_command" at 0410 each day.
>
>
> > Whats the command to make them executable? I'm sort of new with linux
but I
> > think I remember its chmod with some sort of flag.
> >
> > Is that correct?
>
> "chmod +x filename" will make 'filename' executable.
> _______________________________________________
> 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