Skip to content

CLI Reference

Jagad is a single-binary application that runs as a web server. There is no standalone CLI mode for one-off backup/restore operations — all operations are performed through the REST API or the Web UI.

Usage

bash
jagad [command] [options]

Commands

serve (Default)

Start the Jagad web server. This is the default command and the primary way to run Jagad.

bash
jagad serve

Or simply:

bash
jagad

Flags:

FlagEnvironment VariableDefaultDescription
--port (or -p)JAGAD_PORT8080HTTP server listen port
--data-dirJAGAD_DATA_DIR/dataDirectory for SQLite database and runtime data
--admin-userJAGAD_ADMIN_USERadminWeb UI admin username
--admin-passJAGAD_ADMIN_PASSadmin123Web UI admin password
--secret-keyJAGAD_SECRET_KEYAuto-generatedSession signing secret key
--encryption-keyJAGAD_ENCRYPTION_KEY(empty)AES-256-GCM backup encryption key (enables encryption)
--master-keyJAGAD_MASTER_KEY(empty)Master key for credential encryption at rest
--s3-endpointJAGAD_S3_ENDPOINT(empty)S3-compatible storage endpoint (legacy config)
--s3-regionJAGAD_S3_REGIONautoS3 region (legacy config)
--s3-bucketJAGAD_S3_BUCKETbackupsS3 bucket name (legacy config)
--s3-access-keyJAGAD_S3_ACCESS_KEY(empty)S3 access key (legacy config)
--s3-secret-keyJAGAD_S3_SECRET_KEY(empty)S3 secret key (legacy config)
--s3-path-styleJAGAD_S3_PATH_STYLEtrueUse path-style S3 URL (vs virtual-hosted)
--max-concurrentJAGAD_MAX_CONCURRENT3Maximum concurrent backup operations
--versionPrint version and exit

Example:

bash
# Start with encryption and custom port
jagad --port 9090 \
  --encryption-key "$(cat /etc/jagad/encryption.key)" \
  --master-key "$(cat /etc/jagad/master.key)" \
  --data-dir /var/lib/jagad

version

Print the Jagad version and exit.

bash
jagad version

Configuration Priority

Jagad reads configuration in the following order (later overrides earlier):

  1. Default values (compiled into the binary)
  2. Environment variables (jagad_*)
  3. Command-line flags (highest priority)

There is no configuration file support in the CLI binary. The Configuration File reference describes the file format used by the Web UI settings page, not the startup binary.

Environment Variables

All CLI flags have corresponding environment variables. Use JAGAD_ prefix:

bash
export JAGAD_PORT=9090
export JAGAD_ENCRYPTION_KEY="my-encryption-key"
export JAGAD_MASTER_KEY="my-master-key"
export JAGAD_S3_ENDPOINT="https://s3.amazonaws.com"
export JAGAD_S3_BUCKET="my-backups"
export JAGAD_S3_ACCESS_KEY="AKIA..."
export JAGAD_S3_SECRET_KEY="..."
export JAGAD_S3_PATH_STYLE=false
export JAGAD_MAX_CONCURRENT=5
jagad

Required Tools

Jagad checks for required database tools on startup and logs warnings if any are missing:

ToolProvidesRequired For
pg_dumpPostgreSQL full backupPostgreSQL full backups
pg_restorePostgreSQL restorePostgreSQL restores
mysqldumpMySQL/MariaDB full backupMySQL full backups
mysqlMySQL restoreMySQL restores
mariadb-dumpMariaDB full backupMariaDB full backups (preferred)
mariadbMariaDB restoreMariaDB restores (preferred)
pgbackrestPostgreSQL incrementalPostgreSQL incremental backups
xtrabackupMySQL incrementalMySQL incremental backups
mariabackupMariaDB incrementalMariaDB incremental backups

Missing tools do not prevent Jagad from starting — they only affect the corresponding functionality.

Upcoming CLI Commands

The following CLI commands are planned for future releases:

  • jagad backup — Run a backup from the command line (for scripting)
  • jagad restore — Restore a backup from the command line
  • jagad list — List backups
  • jagad config — View/edit configuration
  • jagad log — View backup logs
  • jagad status — Show server/backup status

Currently, these operations are available via the REST API and Web UI.

Released under the Apache 2.0 License.