Tugger the SLUGger!SLUG Mailing List Archives

[SLUG] MySQL dumps per database, how 2 script ?


I have a script that dumps all MySQL databases along these lines:

------
#!/bin/sh
set $(date)
   # create sql dump of databases:
   rm "/backup/database/koala_$3.sql.gz"
   mysqldump -u backup --add-drop-table -F -A > "/backup
   gzip "/backup/database/koala_$3.sql"
------
that works quite well, but, it's a little unwieldy to find invidual
databases amogst the 400,000 lines of dump, so I'd like to dump individual
databases dumped one at at a time

I can dump names of all databases with something like
'mysqlshow'
but not sure how to parse the 'borders' and feed it back to the mysqldump

------
+-------------------+
|     Databases     |
+-------------------+
| atom              |
| commodore         |
------

perhaps some has such a script already ?


-- 
Voytek