Skip to main content
Common Reference

trepctl backup

The trepctl backup command performs a backup of the corresponding database for the selected service.

Usage
trepctl [ common-options ] backup [ options ]

Where:

OptionDescriptionVersion
-backup <agent>Select the backup agent. If not supplied, will use the default set during install.
-limit sThe period to wait (in seconds) before returning after the backup request. If not set, or set to 0 (zero) the time will be unlimited.
-storage <agent>Select the storage agent. if not supplied, will defult to fs

Without specifying any options, the backup uses the default configured backup and storage system, and will wait indefinitely until the backup process has been completed:

shell> trepctl backup
Backup completed successfully; URI=storage://file-system/store-0000000002.properties

The return information gives the URI of the backup properties file. This information can be used when performing a restore operation as the source of the backup. See "cmdline-tools-trepctl-command-restore". Different backup solutions may require that the replicator be placed into the OFFLINE state before the backup is performed.

A log of the backup operation will be stored in the replicator log directory, in a file corresponding to the backup tool used (e.g. mysqldump.log).

If multiple backup agents have been configured, the backup agent can be selected on the command-line:

shell> trepctl backup -backup mysqldump

If multiple storage agents have been configured, the storage agent can be selected using the -storage option:

shell> trepctl backup -storage file

A backup will always be attempted, but the timeout to wait for the backup to be started during the command-line session can be specified using the -limit option. The default is to wait indefinitely. However, in a scripted environment you may want to request the backup and continue performing other operations.

The -limit option specifies how long trepctl should wait before returning.

For example, to wait five seconds before returning:

shell> trepctl -service alpha backup -limit 5
Backup is pending; check log for status

The backup request has been received, but not completed within the allocated time limit. The command will return. Checking the logs shows the timeout:

... management.OpenReplicatorManager Backup request timed out: seconds=5

Followed by the successful completion of the backup, indicated by the URI provided in the log showing where the backup file has been stored.

... backup.BackupTask Storing backup result...
... backup.FileSystemStorageAgent Allocated backup location: uri =storage://file-system/store-0000000003.properties
... backup.FileSystemStorageAgent Stored backup storage file: file=/opt/continuent/backups/store-0000000003-mysqldump_2025-02-25_18-14_11.sql.gz length=0
... backup.FileSystemStorageAgent Stored backup storage properties: file=/opt/continuent/backups/store-0000000003.properties length=314
... backup.BackupTask Backup completed normally: uri=storage://file-system/store-0000000003.properties

The URI can then be used during a restore (See trepctl restore for more information.