[mythtv-users] How big is your database?

mythtv-users at fastdruid.co.uk mythtv-users at fastdruid.co.uk
Mon Dec 5 14:59:29 EST 2005


On Saturday 03 December 2005 21:35, Larry K wrote:
> Anyone care to post their scipt to back up/compress their database?    I
> suppose I could write my own, but why reinvent the wheel? :)

It's not big or clever[0] but this works for me, keeps 7days worth of 
compressed + one uncompressed latest backup, the --add-drop-table isn't 
really needed but I use it as it makes it easier (for me) to mix and match 
what tables to restore.

#!/bin/bash

/usr/bin/mysqldump -all --add-drop-table -u mythtv -pmythtv mythconverg -c 
> /home/backup/latest_db_backup.sql

cp /home/backup/latest_db_backup.sql /home/backup/db_backup_$(date '+%u').sql

gzip -f /home/backup/db_backup_$(date '+%u').sql

HTH

David

[0] Simple means less to go wrong :-)





More information about the mythtv-users mailing list