Paul Walker on 17 Jul 2012 08:38:31 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Server Backup best practices...


If the database dump is nightmarish how about creating a script to do it on a table-by-table basis?
I've done a shell script like this in the past:
for tablename in table1 table2 table3 table4 table5
do
  mysqldump -u user  --password=thepassword dbname $tablename > backup_${tablename}.sql
done

Eric that's a good idea. Also, I believe there's a --tabbed flag that will do something similar, pushing the schema to a file structure and exporting the tables into that file tree..

On Tue, Jul 17, 2012 at 11:29 AM, Eric at Lucii.org <eric@lucii.org> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/17/2012 11:19 AM, Paul Walker wrote:
> +1. grabbing the raw files *might* work, but generally, it's not safe to trust anything that isn't a dump.
>
>
> Ugh... _getting_ the dump is a bit of a nightmare

If the database dump is nightmarish how about creating a script to do it on a table-by-table basis?

I've done a shell script like this in the past:

for tablename in table1 table2 table3 table4 table5
do
  mysqldump -u user  --password=thepassword dbname $tablename > backup_${tablename}.sql
done

Obviously won't work if all your data is in one humongous table.

Best of luck!

Eric

> On Tue, Jul 17, 2012 at 11:12 AM, Claude M. Schrader <plug@claudeschrader.com <mailto:plug@claudeschrader.com>> wrote:
>
> On 11:04 Tue 17 Jul     , Conor Schaefer wrote:
>> On Tue, Jul 17, 2012 at 10:37 AM, Paul Walker <[1]starsinmypockets@gmail.com <mailto:starsinmypockets@gmail.com>> wrote:
>>
>> I believe it's not good practice to trust anything that mysql has written to disk that isn't a fresh dump. Any backup script should perform a dump and back that up. No advice on coaxing better performance out of mysql, sorry.
>
> +1. grabbing the raw files *might* work, but generally, it's not safe to trust anything that isn't a dump. Claude


- --
#  Eric Lucas
#
#                "Oh, I have slipped the surly bond of earth
#                 And danced the skies on laughter-silvered wings...
#                                        -- John Gillespie Magee Jr

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAFhO8ACgkQ2sGpvXQrZ/6FIwCgtVQMM7+hq7lpud1MGUd2QmlA
qsAAn3bgnCpwZvsIQ0Me34ll22p1P6XJ
=Oabq
-----END PGP SIGNATURE-----
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug