meta data for this page
  •  

Splitting backups

To run gsplit, you need to use it as a filter on the command line for gbak, as the following example shows:

C:\>gbak -b norman.fdb stdout |
    gsplit -split norman_1.fbk 1m norman_2.fbk 1m norman_3.fbk

Warning: The command above assumes that ISC_USER and ISC_PASSWORD have been defined. For the sake of this demonstration, this is acceptable, but in a real system, consider the security implications before defining these variables.

In addition, the above command line has been split over two lines to allow the pdf generation of this manual to work. In reality, the command must be typed on a single line.

It is unfortunate that the utility supplied with Firebird 1.5 doesn't work, as the following shows:

C:\>gbak -b norman.fdb stdout |
    gsplit -split norman_1.fbk 1m norman_2.fbk 1m norman_3.fbk

fail to read input from ib_stdin, errno = 9
gsplit: progam fails to generate multi-volumn back-up files

Done with volume #0, "stdout"
        Press return to reopen that file, or type a new
        name followed by return to open a different file.
Name:^C

If you type a filename at the prompt it will simply be used as a destination for a full dump of the database, so be careful not to overwrite anything important. I tend to hit [CTRL + C] at this point to avoid problems.

The utility has actually created the first file in the above list, norman_1.fbk, and written 100 bytes to a special header which identifies it as a gsplit-created file.

Warning: The command above assumes that ISC_USER and ISC_PASSWORD have been defined. For the sake of this demonstration, this is acceptable, but in a real system, consider the security implications before defining these variables.

In addition, the above command line has been split over two lines to allow the pdf generation of this manual to work. In reality, the command must be typed on a single line.

Note: The spelling errors in 'program' and 'volume' above are as produced by the utility.

The command does work under Firebird 2, however, it only creates the first file and then prompts for a new filename for the second file as the following shows:

C:\>gbak -b norman.fdb stdout |
    gsplit -split norman_1.fbk 1m norman_2.fbk 1m norman_3.fbk

Done with volume #1, "stdout" Press return to reopen that file, or type a new
        name followed by return to open a different file. Name:

If you press return at the prompt, the second file will be named stdout and not norman_2.fbk. If, on the other hand, you supply the filename norman_2.fbk then that file will be written to. Unfortunately you cannot specify how large the file is allowed to be; if you try, the file size becomes part of the file name.

Warning: I would say that as with Firebird 1.5's version of gsplit, using it to split a backup file is pointless. Use the gbak method to be safe.