Product Documentation

Database Administrator's Guide

Previous Topic

Next Topic

ctdump - Schedule Backup Utility

Note: For a complete discussion of dynamic dumps, see Backups and Data Integrity in the FairCom Server Administrator's Guide.

Operational Model:

  • Client

ctdump schedules a dynamic dump on the fly. The backup definition script may be located either on the server, or passed in from the client.

Command Syntax

ctdump [-s svn] [-u uid] [-p upw] [-t script] [-b bufsiz] [-n] [-c] [-o backup_filename] [-x]

Options

  • -s svn - c-tree Server name
  • -u uid - User name
  • -p upw - User password
  • -t script - Dump script name
  • -b bufsiz - Use buffer size of bufsiz bytes
  • -c - Send dump script from client
  • -m - Minimize progress notifications
  • -n - Send progress notifications to client
  • -o backup_filename - Write dump stream from server to file on client
  • -x - Write dump stream from server to stdout

For options available when scripting a dynamic dump, see Dynamic Dump Options.

The following demonstrates example usage of this utility:

ctdump ADMIN ADMIN thescript FAIRCOMS

Secure Authentication File

This utility supports the use of an encrypted password file. Encrypted password files keep user IDs and passwords from plain view when the utility is used within a script file. They are created with the ctcmdset utility. The plain text form of the file should be:

; User Id
USERID ADMIN
; User Password
PASSWD <pass>

Use the -1 option to specify the name of the encrypted file.

Dump and Restore Version Compatibility

The ctrdmp utility is used to restore a Dynamic Dump and the ctfdmp utility can be used to roll forward. Occasionally an update to the FairCom Database Engine may cause an incompatibility between versions. For this reason you must use the ctrdmp from the same release from which the dump was created. It is important to save a copy of the ctrdmp utility that is compatible with each dump file. ctfdmp, ctldmp, and ctrdmp utilities display the FairCom DB version used to compile them when they are run.

Compression and Encryption

The ctdump.exe utility can accept compression and encryption utility inputs.

Windows backup compressed with 7z compression utility:

ctdump -s FAIRCOMS -u admin -p ADMIN -t dump.txt -c -x | 7z a -si backup.7z

Unix backup compressed and AES encrypted with standard utilities:

./ctdump -s FAIRCOMS -u admin -p ADMIN -t dump.txt -c -x | gzip|openssl enc -aes-256-cbc -salt >backup.gz.aes

Tip! Unix/Linux Alternative

This method also works with server-side dynamic dump backups prior to this new support and can be implemented on Unix systems using named pipes (mkfifo), and sending the dump to the named pipe.

  1. Create a named pipe:

    mkfifo testpipe

  2. The pipe blocks until both sides are in use. So we start our compression command:

    cat testpipe | gzip > backup.gz &

  3. Now we create our dynamic dump, with "testpipe" as the dump file. (This example uses the client output, however it should work the same from the server):

    ctdump -s FAIRCOMQ -u admin -p ADMIN -t dump.txt -c -o testpipe

    c-tree(tm) Version 11.8.0.61131(Build-180802) Dynamic Backup Utility

    Copyright (C) 1992 - 2018 FairCom Corporation

    ALL RIGHTS RESERVED.

    Reading dump stream from server with buffer size of 100000

    Dynamic Dump has been successfully written to the file testpipe.

  4. The backup.gz file contains the dump file.

The same approach can be used to compress and encrypt (and potentially other operations provided by system utilities):

cat testpipe|gzip|openssl enc -aes-256-cbc -salt >backup.gz.aes

To extract the dump:

cat backup.gz.aes | openssl enc -aes-256-cbc -d |gzip -d >backup.ctree

Use ctrdmp to extract the files from backup.ctree.

Error Codes

The following error codes are related to dynamic dump operations:
 

Error Name

Error Code

Explanation

FUNK_ERR

13

Cannot determine file type. Possibly a c-tree V4.3 file?

READ_ERR

36

Failed to read file, either a corrupted or non-tree file.

TCOL_ERR

537

Transaction log collision. Two sets of transaction logs in the same directory?

FCPY_ERR

796

Immediate dump restore file copy failed.

DRST_ERR

797

Immediate dump restore failed.

See Also:

TOCIndex