Command Reference
Complete reference documentation for all Database Guardian commands.
Command options are case-sensitive. Be sure to type them exactly as shown.
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
| Option | Description | Required | Default |
|---|---|---|---|
| --dbms | Type of the database | Yes | postgres |
| --host | Database host | Yes | localhost |
| --port | Database port | Yes | - |
| --username | Username for database access | Yes | - |
| --password | Password for database access | Yes | - |
| --dbname | Name of the database to back up | Yes | - |
| --output | Directory to save the backup file | No | - |
Examples
Basic backup of a PostgreSQL database:
guard backup --dbms postgres --host localhost --port 5432 --username postgres --password secret --dbname mydbBackup with custom output location:
guard backup --dbms postgres --host localhost --port 5432 --username postgres --password secret --dbname mydb --output /backups/postgresGlobal Options
| Option | Description |
|---|---|
| --help, -h | Display help information for any command |
| --version, -v | Display version information |
Common Patterns
Getting Help
You can get help for any command using the -h or --help flag:
guard backup -hChecking Command Syntax
Always check the syntax for a command before running it to ensure all required parameters are provided:
guard command_name -hNeed More Help?
Visit our GitHub repository for more examples, issue reporting, and contributions.
GitHub Repository