The gbm command line
Back up, restore and look after GBM AI from a terminal or a script: jobs, restores, licences, share credentials, S3 accounts and the service's account.
On this page
gbm.exe talks to the same background agent as the app, so a script and the window always agree. It is in the install folder, C:\Program Files\Genie9\GBM AI. To type just gbm in any terminal, turn on Settings ▸ Advanced ▸ Command-line access. gbm help lists everything below.
Jobs and runs#
| Command | What it does |
|---|---|
gbm status | what the agent is doing, the licence and the next run |
gbm job list | every job, its last run and whether it is on |
gbm job run <job> | runs it and follows it to the end; --full for a full backup, --copy for its second copy, --no-wait to return at once |
gbm job stop <job> | stops the job's running or queued backup |
gbm job preview <job or file.json> | a dry run: what a backup would take; nothing is written |
gbm job validate <file.json> | checks a job file without saving it |
gbm job export <job> -o file.json | the job as JSON; the encryption password is left out |
gbm job import file.json | saves a job file as a new job (10.2) |
<job> is a job's name, the start of its name, or its id.
gbm job import takes the file Export job JSON… or gbm job export wrote, on this PC or another:
--name "<name>"gives the new job another name.- An encrypted job needs its password, which an export leaves out:
--password-stdinreads it from the input (type pw.txt | gbm job import job.json --password-stdin), or setGBM_PASSWORDfirst. - An S3 job names the S3 account of the PC it came from:
--s3-profile "<name>"uses one saved here instead (seegbm s3below).
Restore#
gbm restore --set <set> --to <folder | original> restores a set. <set> is a set's folder name, its id, its .bm2 file, or latest together with --job <job>. Add --path <path> (repeat it) for some files only, --flat to put every file straight into the folder, and --conflicts skip | newer | overwrite. An encrypted set's password: --password, GBM_PASSWORD, or you are asked.
Licence#
gbm license status shows the edition and its dates; gbm license activate <key> activates a key.
Share credentials and S3 accounts (10.2)#
What Settings ▸ Network & credentials and the wizard's S3 accounts do, for a server with no window:
| Command | What it does |
|---|---|
gbm creds list | the saved credentials for network shares, and how many jobs use each |
gbm creds add \\server\share --user DOMAIN\user | saves a share's user and password |
gbm creds remove \\server\share | removes them |
gbm s3 list | the saved S3 accounts |
gbm s3 add <name> --access-key <id> --endpoint <url> --region <region> | saves one; leave --endpoint out for Amazon S3 |
gbm s3 remove <name> | removes one no job uses |
The password or secret key is never typed on the command line, where other programs could read it: --password-stdin or --secret-stdin reads it from the input, GBM_PASSWORD or GBM_S3_SECRET holds it, or gbm asks for it without showing it.
The service's account (10.2)#
gbm service account shows the account the backup service runs as. gbm service account DOMAIN\user makes it run as that account, and gbm service account LocalSystem puts it back, as Settings ▸ Schedule & power ▸ Runs as does. The account must be in the PC's Administrators group; its password comes as above. Changing it needs a command prompt opened as administrator. See Running backups with nobody signed in.
In a script#
--json on any command prints the agent's own result objects, the ones the app reads. Exit codes: 0 done, 1 failed or stopped, 2 wrong usage, 3 the agent could not be reached, 4 done with skipped files.