[mythtv-users] I am an idiot - deleted everything without DB backup - a question...

Mitch Gore mitchell.gore at gmail.com
Tue Sep 11 12:44:56 UTC 2007

On 9/11/07, Bruce Nordstrand <brucen at ksl.com.au> wrote:
> Jon wrote:
> >> Oh, and I have to get myself a backup command to automatically put a
> >> backup somewhere else on the network. That or don't do Myth rebuilds
> >> when I haven't had enough sleep....
> >>

Here is mine.  Put in /etc/cron.daily/
FN=mythtv_backup-$(date +%Y-%m-%d_%H:%M).sql

mysqldump -u mythtv -pmythtv mythconverg -c > $DIR/$FN

# bzip our db backup so it takes alot less space
bzip2 $DIR/$FN

#delete any backup files that status haven't changed for over 3 days.
rm $(find $DIR -ctime +3 -name "mythtv_backup*")

This keeps 3 but can be modified easily.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070911/1a526869/attachment.htm 

More information about the mythtv-users mailing list