Command Reference

Complete reference documentation for all Database Guardian commands.

backup
Backs up a database to a file

Usage

guard backup --dbms postgres --host localhost --port 5432 --username postgres --password secret --dbname mydb [--output /path/to/dir]

Options

OptionDescriptionRequiredDefault
--dbmsType of the databaseYespostgres
--hostDatabase hostYeslocalhost
--portDatabase portYes-
--usernameUsername for database accessYes-
--passwordPassword for database accessYes-
--dbnameName of the database to back upYes-
--outputDirectory to save the backup fileNo-

Examples

Basic backup of a PostgreSQL database:

guard backup --dbms postgres --host localhost --port 5432 --username postgres --password secret --dbname mydb

Backup with custom output location:

guard backup --dbms postgres --host localhost --port 5432 --username postgres --password secret --dbname mydb --output /backups/postgres

Global Options

OptionDescription
--help, -hDisplay help information for any command
--version, -vDisplay version information

Common Patterns

Getting Help

You can get help for any command using the -h or --help flag:

guard backup -h
Checking Command Syntax

Always check the syntax for a command before running it to ensure all required parameters are provided:

guard command_name -h

Need More Help?

Visit our GitHub repository for more examples, issue reporting, and contributions.

GitHub Repository