Issue Details (XML | Word | Printable)

Key: CORE-4462
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
Firebird Core

Make it possible to restore compressed .nbk files without explicitly decompressing them

Created: 17/Jun/14 10:19 AM   Updated: 18/Jun/14 06:24 AM
Component/s: NBACKUP
Affects Version/s: 3.0 Beta 1
Fix Version/s: None

Sub-Tasks  All   Open   

 Description  « Hide
Ability to compress nbackup output on the fly helps to save both backup time and avoid need in disk space for intermediate uncompressed files:
nbackup -b 0 employee stdout | bzip2 >e.b0.bz2
nbackup -b 1 employee stdout | bzip2 >e.b1.bz2

Unforutnately that trick does not work when restore is needed cause a set of uncompressed files is required for utility:
nbackup -r e.fdb e.b0 e.b1

It would be great to make nbackup decompress files on the fly one by one, without wasting resources for intermediate files.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 17/Jun/14 11:26 AM
Added switch -DEcompress with parameter containing command line decompressing .nbk file to stdout. Symbol @ in that command line is replaced with file name to be decompressed. If that symbol is not met in command line file name (with space before it) is appended to the end of command line. Certainly if command line contains >1 word it should be quoted according to your shell rules.

Samples of how can be restored mentioned in description backup:
nbackup -de bzcat -r e.fdb e.b0.bz2 e.b1.bz2
nbackup -de 'bzip2 -d -c' -r e.fdb e.b0.bz2 e.b1.bz2
nbackup -de 'bzip2 -d -c @' -r e.fdb e.b0.bz2 e.b1.bz2
All this commands give same result - database is successfully restored.

Sean Leyne added a comment - 17/Jun/14 03:30 PM
Wouldn't it make sense to also add a new switch to have the 'backup' step generate a compressed file directly, without the need to pipe the output?

Alexander Peshkov added a comment - 18/Jun/14 06:24 AM
I will check is it possible. If there is opened database at the time of creating backup, this causes some problems when forking.
Anyway first of all I want windows version from Vlad to clone it for backup case.