I would recommend you to use gzip instead of bzip2. Compression rate is worse (in some cases they come close), but compression time is way better. I think i won't be wrong if i say it will reduce your backup time down to 10-12 minutes.

On 25/11/10 05:04, Mike Cochrane wrote:
On 25/11/2010 14:48, Jochen Daum wrote:
>  10. Forgetting to back up
>  Very important! We do nightly database dumps that are stored in our office
>  (DB servers are not in our office) keeping every day for the last week,
>  every week for the last month and every month for the last three. Being in
>  the office we can easily import them on a development server and manually
>  recover rows when clients do silly things.
>
Totally recommended. We do 1 hourly here on server, 6 hourly off
server. Also good if you need to know who broke what when.
I have considered more frequent but there hasn't been a need yet. It currently takes 31 mins for the server to dump all the tables and compress them on the server.

For those who haven't got theirs setup yet - here's the basis of the shell script that we run via a cron job:

    #!/bin/sh

    for db in `echo "show databases;" | mysql --password=[password]
    mysql | grep -v "^Database$"`; do
            dmp="/archive/mysqldump/"$db".mysql.dmp.bz2"
            echo $dmp
            mysqldump --password=[password]--add-drop-table -Q $db |
    bzip2 > $dmp
            chmod 600 $dmp
    done

- Mike


Kind Regards,

Jochen

--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to