Create Backup Plans

As of Backup 4.0 for macOS, a new command line interface (CLI 2.0) is introduced. CLI 2.0 is a new command line interface solution that has the enhanced functionality that covers the new backup format requirements.

Note that creating backup plans in the new backup format is available in the CLI 2.0 only

Learn how to create a new backup plan:

Create a File Backup Plan (new and current backup formats) with CLI 2.0

To create a new backup plan, use the plan create_backup file command.

./cbbV2 plan create_backup file --format nbf --name “Plan Name" --account “Account Name” --source “Source” --confirm

create_backup file. Command Parameters

--format

This parameter sets the backup format of backup plan and is mandatory.

Parameter syntax:

  • --format
  • -f

Possible values:

  • nbf
  • cbf (default value)

--name

This paremeter sets the backup plan name and is mandatory.

Parameter syntax:

  • --name
  • -n

Possible values:

  • None. Default value is: Backup and the date of the backup plan creation

--id

This parameter sets the backup plan ID.

Parameter syntax:

  • --id
  • -i

--account

This parameters sets the storage account name (or account ID) and is mandatory.

Parameter syntax:

  • --account
  • -a

Possible values:

  • Existing storage accounts

-bunch

This parameter sets the specific bunch ID.

This parameter applies to backup plans in the the new backup format only

Parameter syntax:

  • --bunch

Possible values:

  • Bunch IDs

-restore-point

This parameter applies to backup plans in the the new backup format only

Date and time on “dd.MM.yyyy mm:hh” format

Restore point time

-overwrite-files

ON/OFF

Overwrite existing files option

-restore-new-files

Enable the 'Restore only new files' option.

ON/OFF

Restore new files only option

--decryption-password

Decryption password

--storage-class

Sets the storage class for AWS S3 or Azure storage accounts.

Amazon:

  • Standard
  • StandardIA
  • OneZoneIA
  • Glacier
  • Intelligent
  • DeepArchive

Azure:

  • hot
  • cool
  • archive

Amazon:

  • Standart

Azure:

  • hot

–glacier-retrieval-rate

Sets the retrival option for restores from the Glacier-Flexible Retrival or Glacier Deep Archive storage classes.

Possible values:

  • Expedited
  • Standard (default)
  • Bulk,

Glacier retrieval rate (Amazon only)

--sse

true/false false

AmazonS3: use sse --transfer-acceleration -t

true/false false

AmazonS3: Transfer Acceleration --sync

- on/off off

Sync before run --source -s +

Backup source, repeatable param --exclude

-

Exclude file and folders, repeatable param --hidden

- true/false false

Backup system and hidden files --saveconfig

- true/false CBF true Actually only for CBF. always work in NBF Save backup plan configuration to the backup storage --block-level

- true/false CBF false Actually only for CBF. always work in NBF Use block level backup. --compression

- true/false true always off in free license Use compression --encryption -e

true/false false always off in free license Use encryption --encryption-algorithm

If encryption: true aes-128 aes-192 aes-256 aes-256 If encryption: false Encryption algorithm --encryption-password

If encryption: true

If encryption: false

--encryption-hint

If encryption: true

If encryption: false

--empty

- true/false false

Backup empty folders --file-mask-type

- skip backup all

File mask filter type --file-mask

If use file-mask-type

If not use file-mask-type .bak, *.tmp

Examples: plan create_backup

  • ./cbbV2 plan create_backup file --format nbf --name “Plan Name" --account “Account Name” --source “Source” --confirm
  • ./cbbV2 plan create_backup file --format cbf --name “Plan Name" --account “Account Name” --source “Source” --confirm
  • ./cbbV2 plan create_backup file --format nbf --name “Plan Name" --account “Account Name” --source “Source” --confirm
  • ./cbbV2 plan create_backup file --format cbf --name “Plan Name" --account “Account Name” --source “Source” --confirm
  • ./cbbV2 plan create_backup file --name “Plan Name” --account “Account Name" --source ““Source” --confirm

Create a File Backup Plan (current backup format only) with Classic CLI

To create a file-level backup plan using CLI, use the addBackupPlan command. The syntax of the command is as follows:

./cbb addBackupPlan -a "targetStorage" -f "/dataPath1" -f "/datapath2"

where:

  • Mandatory Parameters:
Parameter Description Value
-a AccountID or Account Name String
-f Path of data that should be backed up String

You can get the account names of your target storage by executing the following command:

  • Optional parameters:
Parameter Description Value
-n Plan name String
-useBlockLevelBackup Block-level backup yes / no
-en (deprecated) Enable schedule yes / no
-standardIA Back up files to S3 Standard-IA (Amazon only) yes / no
-sse User server-side encryption (Amazon only) yes / no
-sta User S3 Transfer Acceleration (Amazon only) yes / no
ef Exclude subdirectories from specified backup directories String
-es Exclude system and hidden files yes / no
-ea Encryption algorithm AES_128 / AES_192/ AES_256 __
-ep Encryption password String
-bef Back up empty folders yes / no
-ifm Include certain file types "*.doc, *.xls"
-efm Exclude certain file types. Note that using ifm and efm simultaneously will not work. "*.flac, *.psd"
-c Compression yes / no (default)
-purge Purge file versions older than a specified period 1d / 1w / 1m
keepLastVersion Always retain the last version yes / no
-dl Remove locally deleted data from the cloud yes / no
-dld Delay for the -dl parameter Number of days (e.g. 14)
-notification Indicates if email notifications should be sent upon backup execution / failure on / off / errorOnly
-subject Specifies the subject for email notifications. The following macros are available for subject: %COMPUTER_NAME%, %RESULT%, %PLAN_NAME% String
-runMissed Execute missed scheduled plan upon computer boot-up yes / no (default)

Scheduling Parameters

Scheduling Parameters:

Parameter Description Value
-at Time at which the backup should be executed "dd.mm.yyyy hh:mm" for one-time backup / "hh:mm" for recurring backup
-every Recurrence type day / week / month / dayofmonth
-recurrencePeriod Plan recurrence frequency within a period (in minutes) Integer from 0 to 60
-worktime The period for -recurrencePeriod hh:mm-hh:mm
-weekday Days on which backup will be performed {-every week} String (e.g. "mo, tu, fr, sa")
-day The day on which a monthly backup is to be performed {-every dayofmonth} Integer from 1 to 31
-weekNumber Specifies the week in which a monthly backup should be executed First / Second / Third / Fourth / Penultimate / Last
-repeatEvery Recurrence period for monthly backups Integer from 1 to 12
-repeatFrom Specifies the start date for monthly backups "dd.mm.yyyy"
-forceStop Terminate the plan if it executes longer the specified period "hh:mm"

Scheduled Full Backup Parameters

Scheduled full backup parameters for block-level backup:

Parameter Description Value
-atFull Time at which the backup should be executed "dd.mm.yyyy hh:mm" for one-time backup / "hh:mm" for recurring backup
-everyFull Recurrence type day / week / month / dayofmonth
-recurrencePeriodFull Plan recurrence frequency within a period (in minutes) Integer from 0 to 60
-worktimeFull The period for -recurrencePeriod hh:mm-hh:mm
-weekdayFull Days on which backup will be performed {-every week} String (e.g. "mo, tu, fr, sa")
-dayFull The day on which a monthly backup is to be performed {-every dayofmonth} Integer from 1 to 31
-weekNumberFull Specifies the week in which a monthly backup should be executed First / Second / Third / Fourth / Penultimate / Last
-repeatEveryFull Recurrence period for monthly backups Integer from 1 to 12
-repeatFromFull Specifies the start date for monthly backups "dd.mm.yyyy"
-forceStopFull Terminate the plan if it executes longer the specified period "hh:mm"

For example, the following command creates a backup plan entitled Documents that backs up data to Amazon S3 one time on March 27, 2018 at 23:00:

./cbb addBackupPlan -a "S3" -n "Documents" -f "/users/robert/Documents" -at "27.03.2018 23:00"

The following command creates a backup plan that is scheduled to execute daily at 9 p.m:

./cbb addBackupPlan -a "My S3 account" -n "Documents" -f "/users/robert/Documents" -every day -at "21:00"

The following command creates a backup plan that is scheduled to execute every Monday, Wednesday, and Friday at 2 a.m:

./cbb addBackupPlan -a "My S3 account" -n "Documents" -f "/users/robert/Documents" -every week -weekday "mo, we, fr" -at "02:00"

The following command creates a backup plan that is scheduled to execute on the first day of every month at 6 a.m. starting from May 1st, 2018:

./cbb addBackupPlan -a "My S3 account" -n "Documents" -f "/users/robert/Documents" -every dayofmonth -day 1 -repeatEvery 1 -repeatFrom "01.05.2018" -at "02:00"

The following command creates a backup plan that is scheduled to execute every 10 minutes:

./cbb addBackupPlan -a "My S3 account" -n "Documents" -f "/users/robert/Documents" -every day -recurrencePeriod 10 -worktime "00:00-23:59"

To enable or disable scheduling, execute the following command:

./cbb changePlanState -n "plan's name" -s on/off

All-inclusive Example

The following command creates a backup plan and specifies just about every option available:

./cbb addBackupPlan
-a "My S3 account"
-n "Documents"
-f "/Users/robert/Documents" -f "/Users/robert/Desktop" -f "/Users/robert/Xcode"
-ef "/Users/robert/Desktop/movies"
-useBlockLevelBackup yes
-es yes
-standardIA yes
-sse yes
-sta yes
-ea AES_256
-ep mySplendidPassword
-bef yes
-c yes
-ifm "*.cpp, *.h"
-purge 1m
-keepLastVersion yes
-dl yes
-dld 30
-notification errorOnly
-subject "Backup Plan: %PLAN_NAME% on %COMPUTER_NAME% executed with status %RESULT%"
-every day -at "21:00"
-everyFull week -atFull "00:00"

To execute the plan, execute the following command:

./cbb plan -r "plan's name"
https://git.cloudberrylab.com/egor.m/doc-help-std.git