[mythtv-users] Database backup

anders smith 4nders at gmail.com
Wed Mar 2 11:49:28 UTC 2005


Sorry about my ignorance but I can see that you now have quotation
marks around the filename.... do I need those?

--snip---
"/myth/mythtv_backup.`date '+%w'`.sql.gz"
--snip---

anders

On Wed, 2 Mar 2005 06:36:00 -0500, cythraul <cythrault at gmail.com> wrote:
> You are quite right. Cron does not like backticks.
> 
> Put the line in a script:
> 
> backupmythconverg.sh:
> #!/bin/sh
> /usr/bin/mysqldump -u mythtv -pmythtv mythconverg -c | gzip -c >
> "/myth/mythtv_backup.`date '+%w'`.sql.gz"
> 
> and add the script in your crontab.
> 
> Hope this help.
> 
> In the same script I have:
> 
> for i in recs vids mp3 pics posters mythtv_backup*.sql.gz
> do
>   echo "-- $i"
>   /usr/bin/rsync -ru --delete /myth/$i/ root at remotehost:/myth/$i
>   echo "--"
> done
> 
> Which syncs my myth directory on another machine. Automating this
> however requires the remote host to get a key. A simple howto on that
> part:
> 
> http://zettai.net/Support/Howto/1099598279
> 
> good day,
> cyth
> 
> On Wed, 2 Mar 2005 10:52:35 +0100, anders smith <4nders at gmail.com> wrote:
> > uuuppps!!!
> > that was supposed ot read:
> >
> > I've installed it, I can get it to work when I execute it from the
> > terminal, but when I put the same code into crontab it gives me this
> > error:
> >
> > /bin/sh: -c: line 1: unexpected EOF while looking for matching ``'
> > /bin/sh: -c: line 2: syntax error: unexpected end of file
> >
> > On Wed, 2 Mar 2005 07:56:34 +0100, anders smith <4nders at gmail.com> wrote:
> > > Thanks for the shell script. I's just what I've been looking for and
> > > haven't been able to figure out on my own...
> > >
> > > I've installed it, but I can get it to work when I execute it from the
> > > terminal, but when I put the same code into crontab it gives me this
> > > error:
> > >
> > > /bin/sh: -c: line 1: unexpected EOF while looking for matching ``'
> > > /bin/sh: -c: line 2: syntax error: unexpected end of file
> > >
> > > Anyone have a suggestion as to how I can fix it?
> > >
> > > thanks
> > > anders
> > >
> > >
> > > On Wed, 16 Feb 2005 21:07:07 -0500, cythraul <cythrault at gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I just thought I'd pass the knowledge...
> > > >
> > > > While my cron has been running the following for quite some time:
> > > >
> > > > mysqldump -u root -pPASSWORD mythconverg -c | gzip -c >
> > > > /myth/mythtv_backup..sql.gz
> > > >
> > > > I almost lost my DB yesterday when the volume (root in my case) filled
> > > > itself. I noticed the problem after the above command ran, thus
> > > > overwriting my DB backup. (doh!)
> > > >
> > > > Fortunately, I rsync my /myth volume weekly (which caused the problem
> > > > in the first place since /mnt was not mounted... anyway. :) and a
> > > > valid backup was still on the synced volume.
> > > >
> > > > Btw, here's the command I use to rsync:
> > > >
> > > > /usr/bin/rsync --progress -ru --delete /myth /mnt
> > > >
> > > > In order to avoid future problems, I changed the cron job for the DB backup to:
> > > >
> > > > mysqldump -u root -pPASSWORD mythconverg -c | gzip -c >
> > > > /myth/mythtv_backup.`date '+%w'`.sql.gz
> > > >
> > > > … which will create a seven day fallback just in case. (Check out the
> > > > man page of date for more option like %w -- %w = weekday where
> > > > 0=sunday.)
> > > >
> > > > In the hopes that some potentially poor soul will implement something
> > > > similar on their system. :)
> > > >
> > > > And, that make me think, would it not be a good idea to have something
> > > > directly in Myth to deal with DB backups or should it be handled
> > > > purely outside like my cron job...?
> > > >
> > > > Hasta,
> > > > cyth
> > > >
> > > >
> > > > _______________________________________________
> > > > mythtv-users mailing list
> > > > mythtv-users at mythtv.org
> > > > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> > > >
> > > >
> > > >
> > >
> >
> 
> 
> _______________________________________________
> 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