Skip to content

Latest commit

 

History

History
230 lines (152 loc) · 2.76 KB

manual.md

File metadata and controls

230 lines (152 loc) · 2.76 KB

Commands

capdb add [options]

Description: Add database credentials for container backup.

Options:

  • -c, --container <string>: Container name.
  • -t, --type <string>: Database type.
  • -n, --name <string>: Database name.
  • -u, --username <string>: Username.
  • -p, --password <string>: Password.
  • -f, --frequency <number>: Backup frequency.

Example:

$ capdb add -c my_container -t mysql -n my_db -u root -p secret -f 30

capdb remove [options]

Description: Remove database credentials.

Options:

  • -id, --id <string>: Credential ID.
  • -a, --all: Remove all credentials.

Example:

$ capdb remove -id 1234

capdb update [options]

Description: Update container information.

Options:

  • -id, --id <string>: Credential ID.

Example:

$ capdb update -id 1234

capdb start

Description: Start scheduled backups.

Example:

$ capdb start

capdb restore [options]

Description: Restore database backup.

Options:

  • -idx, --index <number>: Container index.

Example:

$ capdb restore -idx 2

capdb config [options]

Description: Configure capdb.

Options:

  • Various S3 options.

Example:

$ capdb config -d

capdb status

Description: List scheduled databases.

Example:

$ capdb status

capdb list

Description: Alias to status.

Example:

$ capdb list

capdb log

Description: View backup logs.

Example:

$ capdb log

capdb stop

Description: Stop the backup scheduler.

Example:

$ capdb stop

capdb scan

Description: List all running containers.

Example:

$ capdb scan

capdb export

Description: Export all the capdb config as json to desktop.

Example:

$ capdb export

capdb import [options]

Description: Import all the capdb config from a json file.

Options:

  • -f, --file <string> File path to import from.

Example:

$ capdb import -f /path/to/file.json
{
	"containers": [
		{
			"id": 1,
			"container_name": "postgres",
			"database_type": "postgres",
			"database_name": "database",
			"database_username": "username",
			"database_password": "password",
			"status": 0,
			"back_up_to_s3": 0,
			"back_up_frequency": 1,
			"last_backed_up_at": null,
			"last_backed_up_file": null
		}
	],
	"config": [
		{
			"id": 1,
			"capdb_config_folder_path": "/Users/wajeht/capdb",
			"s3_access_key": null,
			"s3_secret_key": null,
			"s3_bucket_name": null,
			"s3_region": null
		}
	]
}

To use any command, run capdb [command] [options] in the terminal.