Create Backup Plans

As of Backup 4.0 for Linux, a new command line interface (CLI V2)is introduced. CLI V2 is a separate 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 v2 only

Find the CLI 2.0 documentation in the cli 2.0 section.

Create a File Backup Plan (current backup format only)

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