0

We have an regular backup system which backs up every table from the DB into a separate files.

Like a table named

fo

will be dumped and compressed into a

foo.sql.bz2

I googled this kind of compresion and all i could think of to get it but i am out of ideas.

Anyone knows which tool is making backups like this and how can i restore the whole DB from milions of thouse files?

ps. We have over 700 tables, so resoring one by one is... kinda inpractical.

Sangoku
  • 1,588
  • 2
  • 21
  • 50

1 Answers1

1

The .bz2 extension usually denotes a BZ2-compressed archive.

To decompress:

bzip2 -d foo.sql.bz2 # produces file "foo.sql"

Combine with find, and the magic happens:

find /path/to/dump/directory -name "*.sql.bz2" | xargs bzip2 -cd {} | mysql [options]
Community
  • 1
  • 1
RandomSeed
  • 29,301
  • 6
  • 52
  • 87