Using Command Line in Backup Agent for Linux (classic CLI)
To start using the command line, start a new terminal session, then navigate to the directory that contains the cbb or "cbbV2" (CLI2.0) tool:
cd "/opt/local/Online Backup/bin"
If there is branding and the folder has a different name, then the executable file "cbb" (legacy CLI) or "cbbV2" (CLI2.0) can be found like this:
ubuntuuser@ubuntu:/$ cd /opt/local/
ubuntuuser@ubuntu:/opt/local$ sudo find -name "cbb"
./Online Backup/bin/cbb
ubuntuuser@ubuntu:/opt/local$ cd "./Online Backup/bin/"
or (to find an executable for CLI2.0, which is currently preferable to classic CLI)
ubuntuuser@ubuntu:/$ cd /opt/local/
ubuntuuser@ubuntu:/opt/local$ sudo find -name "cbbV2"
./Online Backup/bin/cbbV2
ubuntuuser@ubuntu:/opt/local$ cd "./Online Backup/bin/"
Select Edition
As of version 3.1.2 of Backup Agent for Linux, you can select the required edition from the list of available editions
To select the required edition, use the following command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb option -set edition
Online Backup Command Line Interface started
cbb option -set edition -v <value>
-v <value>: Specify edition with possible values
Possible values: Server, Ultimate
Add New Managed Backup User
To add a new user, run the ./cbb addAccount command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb addAccount
Online Backup Command Line Interface started
addAccount < -e user_email -p password -edition Edition [-bp backup_prefix] [-ssl <yes(default) | no>] | -d DisplayName -st StorageType >
-e email : Specify user email
-p password : Specify password for user
-edition Edition : Specify edition. Possible values: desktop(default), ultimate.
-bp backupPrefix : Backup prefix to differentiate between backups from different computers. Optional, by default is computer name
-ssl <yes | no> : Use SSL. Possible values: yes(default), no
-st Storage type : for more info select one storage type
StorageTypes :
- FileSystem
-h : Show help
User name or storage type must be specified!
Add Storage Account
To create a local backup destination, you need to specify a File Storage account:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb addAccount
Online Backup Command Line Interface started
addAccount < -e user_email -p password -edition Edition [-bp backup_prefix] [-ssl <yes(default) | no>] | -d DisplayName -st StorageType >
-e email : Specify user email
-p password : Specify password for user
-edition Edition : Specify edition. Possible values: desktop(default), ultimate.
-bp backupPrefix : Backup prefix to differentiate between backups from different computers. Optional, by default is computer name
-ssl <yes | no> : Use SSL. Possible values: yes(default), no
-st Storage type : for more info select one storage type
StorageTypes :
- FileSystem
-h : Show help
User name or storage type must be specified!
List Available Storage Accounts
To interact with available storage accounts, execute the following command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb account
Online Backup Command Line Interface started
account [-l] [-sync acc_name]
-l : list all accounts
-sync acc_name : synchronize account.
-h show help
Synchronize Repository
Specify the following parameters to run a repository synchronization.
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb account -sync "b2"
Online Backup Command Line Interface started
Success
Note that the storage account name must be in quotes.
Edit Storage Account
To edit a storage account, use the following command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb editAccount -d "s3 test"
Online Backup Command Line Interface started
editAccount -d <displayName> [-bp backupPrefix] [-ssl <yes|no>]
-d displayName : Account name to edit.
-bp backup_prefix : Backup prefix to differentiate between backups from different computers. Optional, by default is computer name.
-ssl <yes | no> : Use SSL.
-h show help
Note that the storage account name must be in quotes
Create a Backup Plan
To create a backup plan, use the ./cbb addBackupPlan command.
To get general help for the commands, run the following command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb addBackupPlan
Online Backup Command Line Interface started
...
-n Plan name
-a AccountID or AccountName
-amazonStorageClass Specify Amazon S3 Storage Class. Possible values: standard(default), standardIA, oneZoneIA, glacier, intelligent, deepArchive, glacierir.
-sse Use SSE. Possible values: yes(default), no
-sta Use Amazon S3 Transfer Acceleration. Possible values: yes(default), no
-azureBlobTier Specify Microsoft Azure Blob Storage tier. Possible values: hot(default), cool, cold, archive
etc.
The output contains special parameters, where:
- Backup Settings
- -n Plan name
- -a "AccountID" or "AccountName". The value of the account name you can find in the Management Console. In the Storage Accounts tab, find the required storage account, click the gear icon, select View Backup Destinations, and learn the value in the Display Destination Name column)
- -en enable a plan after creation. Possible values: yes (default) | no
- -rrs - use RRS (for Amazon S3 only). Possible values: yes | no (default)
- -sse - use SSE (for Amazon S3 only). Possible values: yes | no (default)
- -f - file or folder to back up. To specify multiple files/folders, use -f for every file/folder.
Example:
-f "/home/USERNAME/Downloads/stats.txt" -f "/home/USERNAME/Downloads/WeeklyReports"
-ef - exclude a file or a directory from a backup procedure. To exclude more than one object, use -ef for each object.
Example:
-f "/home/USERNAME/Downloads/stats.txt" -f "/home/USERNAME/Downloads/WeeklyReports" -ef "/home/USERNAME/Downloads/WeeklyReports/Sunday" -ef "/home/USERNAME/Downloads/WeeklyReports/unrelated.txt"
-es - exclude system files from the backup procedure.
Possible values:
- yes (default)
- no.
The following folders will be excluded: /bin; /boot; /cdrom; /dev; /etc; /media; /lib; /lib64; /lost+found; /mnt; /opt; /proc; /run; /sbin; /srv; /tmp; /usr; /var.
-c - use compression. Possible values: yes, no (default). -ea - enable encryption and set an encryption algorithm to use. Possible values:
- AES_128
- AES_192
- AES_256
Used only with -ep parameter.
-ep - encryption password. Used only with -ea parameter.
Example:
-ea "AES_128" -ep "qwerty123"
-bef - back up empty folders. Possible values: yes, no (default).
For example, you are going to:
- backup all the files from the "/home/userubuntu/" directory
- exclude the "/home/userubuntu/Desktop" folder
- use compression
- run every workday at 23:00
- receive notification on completion:
Example of a backup plan creation command execution:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb addBackupPlan -n "Backup my docs" -a "s3 test" -f "/home/userubuntu/" -ef "/home/userubuntu/Desktop" -c yes -every week -at "23:00" -weekday "mo, tu, we, th, fr"
Online Backup Command Line Interface started
Success
Retention Settings
- -purge. Purge versions that are older than the defined period (except the latest version). Possible values: d(day), w(week), m(month)
- -dlv. Delete the last version if it is older than the defined period. Possible values: yes, no
- -keep. Keep a limited number of versions. Possible values: number
- -dl. Delete files that have been deleted locally. Possible values: yes, no
- -dld. Keep the files deleted locally for the specified number of days in case you relax the purge settings and the files become valid again. Possible values: number of days
Example: keep only 3 file versions
-keep 3
Example: keep file versions for 1 week without keeping the last version
-purge 1w -dlv
Schedule Settings
Schedule settings allow you to run a backup at a specific time (-at) or run a recurring backup (-every). Note: Time is always set in UTC:
- -every. Specify a recurring schedule. Possible values: day, week, month, dayofmonth. Two types of schedules: recurring at a certain time (use with -at) and recurring from/to time within a period (use with -workTime in format hh:mm-hh:mm and -recurrencePeriod in minutes)
- -workTime. Specify a time when a plan can be running. Format xx:xx-xx:xx. Example 1: 12:32-17:00; Example 2: 23:00-04:00; may be used for each recurring schedule, used only with -recurrencePeriod and without -at
- -recurrencePeriod. Specify recurrence period in minutes
- -at. Specify datetime or time of a schedule. Example: -at "16.02.2015 12:32" or -at "12:32" for each recurring schedule
- -every day
Example (with -at):
-every day -at "12:31"
Example (with -workTimeand -recurrencePeriod):
-every day -workTime "12:00-16:00" -recurrencePeriod 15
-every week - run every week on a specified day(s) of the week. Used with the -weekday listOfWeekDays parameter. Specify the day(s) of the week for a week schedule: "su, mo, tu, we, th, fr, sa". Use the same options to run -at or with -worktime and -recurrencePeriod.
Example:
-every week -at "13:00" -weekday "mo,su"
-every month. Run every month on a specified day(only one day in a month). You need to specify -weekday and -weeknumber. Possible values: First | Second | Third | Fourth | Penultimate | Last. And the same options to run -at or with -worktime and -recurrencePeriod.
Example:
-every month -at "14:00" -weekday "mo" -weeknumber "Last"
-every dayofmonth. Run every specified day in a month. You need to specify -day. Possible values: 1..31.
Example:
-every dayofmonth -at "03:00" -day 30
-r You can run the plan immediately:
./cbb plan -r "plan_name"
Create Restore Plan
To create a restore plan, use the ./cbb addRestorePlan command. Read the help for the command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb addRestorePlan
Online Backup Command Line Interface started
addRestorePlan -n planName a <accountName | accountID> -sy [yes|no] -rt [LatestVersion|[PointInTime -pointintime date]] <-f file/dir/shareName> <-vol file/dir> [-ep password] [-sta <yes | no>] [-se yes|no] [-ol yes|[no -de location] [-on yes|no] -en [yes|no] [[[-every [day, week, month, dayofmonth] <-workTime xx:xx-xx:xx -recurrencePeriod period | -at timeOfDay>] [-day [1..31]] [-weekday list OfWeekDays] [-weeknumber weeknumber] ] | -at onceDateTime] ] [-repeateEvery NumOfMonthes -repeatFrom FromDate]
-n Plan name
-a AccountID or AccountName
-sy Sync before run. Possible values: yes, no(default)
-rt Restore type LastVersion(default)|PointInTime, if PointInTime must be specified time point, Example: -rt PointInTime -pointintime "16.02.2015 12:32"
-pointintime "16.02.2015 12:32", to be used with -rt PointInTime
-f Restore file or directory
-sta Use Amazon S3 Transfer Acceleration. Possible values: yes(default), no
-vol Restore file or directory from USB flash drive
-ep Encryption password
-PointInTime date
-se Skip existing files. Possible values: yes(default), no
-ol Restore to original location. Possible values: yes, no
-de Restore destination, used only with -ol = no
-on Restore only new files. Possible values: yes(default), no
-en Enable schedule. Possible values: yes, no(default)
-every Specify recurring type. Possible values: day, week, month, dayofmonth
-workTime Time when plan working, format xx:xx-xx:xx Example 1: 12:32-17:00, Example 2: 23:00-04:00; may be used for each recurring schedule, used only with -recurrencePeriod and without -at
-recurrencePeriod Specify recurrence period in minutes
-at Specify datetime or time of schedule. Example "16.02.2015 12:32" , or "12:32" for each recurring schedule
-day Specify day for 'dayofmonth' schedule (1..31)
-weekday Specify day(s) of week for weekly schedule. Example: "su, mo, tu, we, th, fr, sa". Or specify day of week for monthly schedule
-weeknumber Specify number of week. Possible values: First, Second, Third, Fourth, Penultimate, Last
-repeatEvery Specify repeat period for Month/DayOfMonth recurrence schedule type
-repeatFrom Specify start date for -repeatEvery for Month/DayOfMonth recurrence schedule type
-forceStop Stop plan if it runs for "hh:mm" minutes. Possible values: no(default), "hh::mm" minutes
-runMissed Run missed scheduled plan immediately upon boot-up. Possible values: yes, no(default)
Examples:
1. Restore all files from "/" directory with sync before restore, with decryption AES128 pass=dlfkjt no skip existing, only new files. restore to /home/link/workspace/testRestore/ every day at 11:40 UTC cbbCommandLine addRestorePlan -n RestPlan -a "Destination Name" -sy yes -f / -ep dlfkjt -se no -ol no -de /home/link/workspace/testRestore/ -on yes -every day -at 11:40
For example, you are going to restore only new files from the "/" folder by running the sync before restoring to /home/link/workspace/testRestore/. Files are encrypted with the pass = qwert123. Run restore every day at 11:40:
./cbb addRestorePlan -n "RestorePlan" -a "myaccount" -sy yes -f "/" -ep "qwert123" -se no -ol no -de "/home/link/workspace/testRestore/" -on yes -every day -at "11:40"
Note: the sequence of parameters is strongly fixed
The output contains special parameters, where:
- Restore Settings
- -n - a plan name
- -a - "AccountID" or "AccountName". (You can find it on the MBS control panel. Go to the "Storage Accounts" tab, and refer to the Display Name section in the bottom Destinations list.)
- -en - enable a plan after it has been created. Possible values: yes (default) | no
- -sy - sync before restoring. Possible values: yes| no (default). You need to sync before restoring if you set up a restore plan on a computer that is different from the one you have run a backup on
- -rt - a restore type. Possible values: LastVersion (default) | PointInTime. For PointInTime, you need to specify a timestamp. Example: -rt PointInTime "16.02.2015 12:32"
- -f - restore a file or a folder. Specify the full path to the file or folder you want to restore. To restore multiple objects, use multiple -f parameters
Example:
-f "/home/USERNAME/Downloads/file" -f "/home/USERNAME/Downloads/Folder"
- -ep - a decryption password
- -se - skip existing files. Possible values: yes (default) | no
- -ol - restore to the original location. Possible values: yes | no
- -de - specify a restore destination, used only with the -ol = no
Example:
-ol no -de "/home/USERNAME/anotherFolder/"
- -on - restore only new files. Possible values: yes (default) | no
Schedule settings
Schedule settings allow you to run a restore plan at a specific time (-at) or on a recurring schedule (-every). Note: Time is always set in UTC:
- -every - specify a recurring schedule. Possible values: day, week, month, dayofmonth. Two types of schedules: recurring at a certain time (use with -at) and recurring from/to time within a period (use with -workTime in format hh:mm-hh:mm and -recurrencePeriod in minutes)
- -workTime - specify a time when a plan can be running. Format xx:xx-xx:xx. Example 1: 12:32-17:00; Example 2: 23:00-04:00; may be used for each recurring schedule, used only with -recurrencePeriod and without -at
- -recurrencePeriod - specify recurrence period in minutes
- -at - specify datetime or time of a schedule. Example: -at "16.02.2015 12:32" or -at "12:32" for each recurring schedule
- -every day
Example (with -at):
-every day -at "12:31"
Example (with -workTimeand -recurrencePeriod):
-every day -workTime "12:00-16:00" -recurrencePeriod 15
-every week - run every week on a specified day(s) of the week. Used with the -weekday listOfWeekDays parameter. Specify the day(s) of the week for a week schedule: "su, mo, tu, we, th, fr, sa". Use the same options to run -at or with -worktime and -recurrencePeriod.
Example:
-every week -at "13:00" -weekday "mo,su"
-every month. Run every month on a specified day(only one day in a month). You need to specify -weekday and -weeknumber. Possible values: First | Second | Third | Fourth | Penultimate | Last. And the same options to run -at or with -worktime and -recurrencePeriod.
Example:
-every month -at "14:00" -weekday "mo" -weeknumber "Last"
-every dayofmonth. Run every specified day in a month. You need to specify -day. Possible values: 1..31.
Example:
-every dayofmonth -at "03:00" -day 30
-r You can run the plan immediately:
./cbb plan -r "plan_name"
Manage Plans
You can also delete, enable/disable a plan, and list plans.
To list all existing plans, use the ./cbb plan -l command.
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb plan -l
Online Backup Command Line Interface started
Existing plans list:
1. Name: 'Backup my docs'
Id: a325e177-4763-43cb-91ee-7fb7f1fd97f7
Type: File Backup
State: Stopped
Last result: Unknown
To delete a plan, use the ./cbb deletePlan command, where:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb deletePlan
Online Backup Command Line Interface started
deletePlan -n plan_name
-n plan_name : plan to delete
-h show help
To enable/disable a plan, use the ./cbb changePlanState command, where:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb changePlanState
Online Backup Command Line Interface started
changePlanState -n PlanName -s state
-n PlanName : plan name
-s state : state. Possible values: on, off.
-h show help
Troubleshoot and Report Issues
Click Settings, then select Diagnostic and specify the user's email and a short description of the issue. Click Send to support.
OR use the following command to report an issue or send any feedback:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb sendLog
Online Backup Command Line Interface started
sendLog -u user_name [-l] -m message
-u user_name : user name
-m message : message
-l : save logs in temporary directory
-h show help
Example:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb sendLog -u "Test" -m "Test"
Online Backup Command Line Interface started
Sending logs to server...
Report result: Success
Support Case ID : 548063
Logging Level
You can change the logging level using the command line interface. To do this, use the following command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb option -set logging
Online Backup Command Line Interface started
cbb option -set logging -mode <Disable|Low (default)|High|Debug> -rotation <days> -path <path>
-mode <value>: Possible values: Disable, Low (default), High, Debug
-rotation <days>: Number of days to purge log files
-path <value>: Path to logs
Note that the Online Backup path part may be different if you installed the Backup Agent to a custom location
Possible values for -mode parameter:
- Low
- High
- Debug
Configuring Proxy Settings
To configure proxy settings, run the following command:
ubuntuuser@ubuntu:/opt/local/Online Backup/bin$ ./cbb option -set ps
Online Backup Command Line Interface started
cbb option -set ps <-pt type> <-pa proxyAddress> <-pp proxyPort> [-pu proxyUser] [-ps proxyPassword]
-pt type : Proxy type. Possible values: no, manual
-pa proxyAddress : Address
-pp proxyPort : Port
-pu proxyUser : User
-ps proxyPassword : Password
Uninstall Backup Agent
For Ubuntu OS, use the following command: sudo dpkg -r PRODUCT_NAME
For other OS of the Linux family: sudo rpm -r PRODUCT_NAME