[mythtv-users] Mythsqlhotcopy restore

stan stanlist at cox.net
Tue Oct 24 01:48:10 UTC 2006


> -----Original Message-----
> From: mythtv-users-bounces at mythtv.org 
> [mailto:mythtv-users-bounces at mythtv.org] On Behalf Of William Munson
> Sent: Monday, October 23, 2006 3:06 PM
> To: Discussion about mythtv
> Subject: Re: [mythtv-users] Mythsqlhotcopy restore
> 
> stan wrote:
> > I'm using the mythsqlhotcopy script to back up the mythTV 
> database. How do
> > you do a restore?
> >
> > The comments say to copy the files back, run a few mySQL 
> utilities for fix
> > up, and tell mySQL to use the restored files. Do you really 
> need to tell
> > mySQL to use the restored files, or is this done 
> automatically assuming you
> > stop the daemon before replacing the current files with the 
> backup versions?
> >
> > --stan
> >
> >   
> I do my backups manually using mysqldump and I use the 
> --add-drop-table 
> option so for me its as simple as:
> 
> mythbackend stop
> mysql -p mythconverg < /path/to/backup
> mythbackend start
> (restart frontends)
> 
> Yours should be similar although you may have to manually 
> drop the table.
> 
> Can you post a url for that script? I would be interested in 
> checking it 
> out.
> 

Sure.  There's a good discussion here, and the script (that needs a little
modification to point to your specific backup location, etc. it attached as
a text file to the referenced url).

http://www.gossamer-threads.com/lists/mythtv/users/223965?search_string=hotc
opy;#223965

The script works well on my system.  Backup time is under 30 seconds, and I
plan to run it once a day with anacron.  I removed the section to mail the
cron output (since I'm using anacron), and I added -u and -p parms to each
of the mySQL calls so I could run it as root from anywhere.

I think the restore method for hotcopy is different from the restore method
for dump because hotcopy seems to simply lock the tables and copy the raw
files.  I'm still not clear on how to properly restore a hotcopy though.

BTW, in debugging my mods to the script I tried to do a

	bash -x mysqlhotcopy_script | more

That didn't work.  Did the "bash -x" eat the " | more" or something?  How do
you pipe bash -x output to more?

--stan




More information about the mythtv-users mailing list