Creating Restore Plans

Create Restore Plans (CLI 2.0)

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

Create Restore Plan Using CLI 2.0 (new and current backup formats)

To create a new restore plan, use the plan create_restore file command.

./cbbV2 plan create_restore --name “Plan Name" --account “Account Name” --source “Source” --confirm

Create Backup Plan Command Examples

  • ./cbbV2 plan create_restore -a "MyAmazon" -s /home/tmp -c
  • ./cbbV2 plan create_restore -a "MyAzure" -s "/home/tmp –restore-location" "/home/tmp2" -c
  • ./cbbV2 plan create_restore -a test4 -s "/home/jsmith/tmp --overwrite-files "true" --restore-new-files "true" -c
  • ./cbbV2 plan create_restore -a test4 -s /home/jsmith/tmp --decryption-password 123 -c
  • ./cbbV2 plan create_restore -a s3 -s /home/jsmith/tmp --transfer-acceleration true -c
  • ./cbbV2 plan create_restore -a s3 -s /home/jsmith/tmp --glacier-retrieval-rate "Bulk" -c
  • ./cbbV2 plan create_restore -a test4 -s /home/jsmith/tmp --restore-point "12.03.2023 12:00" -c
  • ./cbbV2 plan create_restore -a test4 -s /home/jsmith/tmp --bunch "Bunch" -c. Creates a restore plan with a specific bunch

Run Restore Plan

View the command examples to execute restore plans:

  • ./cbbV2 plan start -n “Plan Name”. This command runs the plan named "Plan name"
  • ./cbbV2 plan start –name “Plan Name”. This command runs the plan named "Plan name"
  • ./cbbV2 plan start –id “Plan ID”. This command runs the restore plan with the "Plan ID" instead of a plan name

Stop Restore Plan

View the command examples to stop running restore plans:

  • ./cbbV2 plan stop -n “Plan Name”
  • ./cbbV2 plan stop –name “Plan Name”
  • ./cbbV2 plan stop –id “Plan ID”

Creating a File Restore Plan (current backup format only) with Classic CLI

Creating a file restore plan in MSP360 (CloudBerry) Backup CLI can be done using the addRestorePlan command. The syntax of the command is as follows:

./cbb addRestorePlan -a "S3" -f "/users/robert/Downloads" -ol yes

where:

  • Required parameters:
Parameter Description Value
-a Account name of the target storage String
-f Path of data in the backup storage that should be restored String
-ol Indicates if data should be restored to the original location yes / no

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

./cbb account -l
  • Optional parameters:
Parameter Description Value
-n Plans' name String
-sy Sync repository prior to restoration yes / no
-rt Restore type LatestVersion / PointInTime
-pointInTime The version that was the latest at the specified date will be restored. "dd.mm.yyyy hh:mm"
-sta User S3 Transfer Acceleration (Amazon only) yes / no
-grt Glacier retrieval rate (Amazon only) Expedited, Standard, Bulk, Skip (don't restore from Glacier)
-vol Restore data from a USB flash drive String
-ep Decryption password String
-se Do not restore existing files yes (default) / no
-de Restore destination. Should only be used if -ol = no String
-notification Indicates if email notifications should be sent upon restore 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

Scheduling Parameters {#scheduling-parameters}

Scheduling Parameters:

Parameter Description Value
-at Time at which the restoration should be executed "dd.mm.yyyy hh:mm" for one-time restoration / "hh:mm" for recurring restoration
-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 restoration will be performed {-every week} String (e.g. "mo, tu, fr, sa")
-day The day on which a monthly restoration is to be performed {-every dayofmonth} Integer from 1 to 31
-weekNumber Specifies the week in which a monthly restoration should be executed First / Second / Third / Fourth / Penultimate / Last
-repeatEvery Recurrence period for monthly restoration Integer from 1 to 12
-repeatFrom Specifies the start date for monthly restoration "dd.mm.yyyy"

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

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

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

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

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

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

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

./cbb addRestorePlan -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 restore plan that is scheduled to execute every 10 minutes:

./cbb addRestorelan -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 addRestorePlan
-a "My S3 account"
-n "Documents"
-f "/Users/robert/Documents" -f "/Users/robert/Desktop" -f "/Users/robert/Xcode"
-ol no
-de "/Users/robert/restoreHere"
-sy no
-rt pointInTime
-pointInTime "01.01.2018 00:00"
-sta no    
-grt Expedited
-ep "decryptionPassword"
-se no
-notification errorOnly
-subject "Restore Plan: %PLAN_NAME% on %COMPUTER_NAME% executed with status %RESULT%"
-every day -at "21:00"
https://git.cloudberrylab.com/egor.m/doc-help-std.git