Command Line Interface for CloudBerry Backup

CloudBerry Backup command line interface allows to backup and restore files from cloud storage, edit global options, list backup plans and account, etc. Command line interface can be used for integrating backup process into production environment.

CloudBerry Backup command line interface is implemented by a little tool called cbb.exe.

To try it out run windows console cmd.exe. Make sure you change your current folder to CloudBerry Backup product installation folder by default at C:\Program Files\CloudBerryLab\CloudBerry Backup Server Edition\ (or for Desktop Edition is C:\Program Files\CloudBerryLab\CloudBerry Onilne Backup\)

Example shows basic usage of command line interface:

Example 1:

Set bandwidth to 100Kb

cbb.exe -o -bw 100

Example 2:

Backup files "C:\work\weekreport.xls" & "C:\work\month.xls" and folder "C:\Documents and Settings\scott" to myaccount with files filter.

cbb.exe backup -a myaccount -f "C:\work\weekreport.xls" -f "C:\work\month.xls" -d "C:\Documents and Settings\scott" -ifm "*.doc;*.docx;*.xls"

Example 3:

Restore files from S3

Latest version of "C:\work\weekreport.xls" will be restored to "c:\restoredfiles\" with overwrite.

cbb.exe restore -a myaccount -rt latest -rl "c:\restoredfiles\" -f "C:\work\weekreport.xls" -o

How to Activate CloudBerry Backup using Command Line

To perform actions listed in this paragraph you need to start the command line interface:

1. Click on the Windows "Start" button.

2. Type cmd.exe in the search line to run the Windows console, press "Enter".

3. Change your current folder to the folder where CloudBerry Backup has been installed, for example:

cd "C:\Program Files\CloudBerryLab\CloudBerry Backup Server Edition"

Online Activation or Request Trial

1. Activate license. (Email & key are required):

cbb activatelicense -e "email" -k "license_key" -or

(where "email" is your personal email and "license_key" is your license key that you received when buying the product).

2. Request trial license. (Email & key are required):

cbb activatelicense -e "email" -t

Offline Activation

If you don't have an ability to activate CloudBerry Backup online you can use offline activation.

1. Generate offline license request using your email and license key:

cbb activatelicense -e "email" -k "license_key" -or

(where "email" is your personal email and "license_key" is your license key that you received when buying the product).

As an output you will get a service key.

2. Send the service key to support@cloudberrylab.com. You will receive the activation key and the license creation date by email.

Note: starting from v3.9.4 you will also need to specify a license creation date (-createdate) parameter.

3. Activate license key

cbb activatelicense -e "email" -k "license_key" -oa "activationkey_received" -createdate "YYYY-MM-DD"

For time limited license you need to specify -expire parameter with the date you received by email:

cbb activatelicense -e "email" -k "license_key" -oa "activationkey_received" -expire "YYYY-MM-DD" -createdate "YYYY-MM-DD"

4. The product is activated.

Moving repository file (CBBackup.db) to alternative location

By default the repository file location is a user profile folder. To move the repository file (CBBackup.db), run the following command:

cbb.exe option -databaseLocation path

where "path" is a new repository file destination. As a result, the CBBackup.db file will be moved to the new location.

Note: Make sure CloudBerry Backup is not open and there are no running backup plans before moving.

Switching to All Users mode

With CloudBerry Backup v2.5 you can switch backup settings from current user profile to the "All Users" profile so that your current settings become available for other users on the computer.

By default the current user profile is used as a settings location. To switch to the "All Users" mode, run the following command:

cbb.exe option -userMode common

As a result, all user settings will be saved in the "all users" profile (C:\ProgramData on Windows 7, 2008 or Vista; C:\Documents and Settings\All Users on Windows XP, 2003) and will be used for any user working with CloudBerry Backup including the current one.

To change the settings mode back to current user, run the following command:

cbb.exe option -userMode current

Note: All settings from "All Users" profile will be moved to the current user profile and since then personal user profile will be used as the settings location.

Setting global options (option):

Use the following command to find more details:

cbb.exe option ?

Parameter Description Value
-userMode Change user mode. By default 'current' mode is used. Each user configures its own plans and settings. If common mode is selected all users of the computer configure the same plans and settings. common, current
-databaseLocation Change database location. By default database is located in user profile. Database will be moved to specified directory for saving space on system drive or other reasons.  
-mssqlTempLocation Change local temporary folder for SQL Server backups. By default backups are located in user profile. Temporary MSSQL backup storage can be moved to specified directory for saving space on system drive or other reasons.  
-bw(andwidth) Change bandwidth Unlimited(u), 1-100000
-proxy Proxy type no, auto, manual
-pa Proxy address  
-pp Proxy port  
-pt Proxy authentication yes,no
-pu Proxy user  
-pd Proxy domain  
-ps Proxy password  
-cs Chunk size in KBs 1-1048576
-t(-threads) Upload threads count 1-99
-purge Purge versions that are older than specified period no, 1d(w,m,y) where d=days, w=weeks, m=months, y =years; 1-400
-keep Keep number of versions all, 1-100
-hp Purge history no, 1d(w,m,y) where d=days, w=weeks, m=months, y =years; 1-400
-hk Keep number of records in history all, 1-100
-l(ogging) Logging level no,l(ow),h(igh),d(ebug)

Setting backup options (backup):

Use the following command to find more details:

cbb.exe backup ?

Parameter Description Value
-a(ccount) Account name  
-aid Account ID  
-f(ile) Backup file  
-d(irectory) Backup directory  
-ifm Include file mask  
-efm Exclude file mask  
-es Except system and hidden files yes(default),no
-c Compress files yes,no(default)
-ea Encryption algorithm no,aes128,des64,rc240,3des112,...
-ep Encryption password  
-rrs Use reduced redundancy storage yes,no(default)
-s(imple) Use simple mode yes,no(default)
-oa(onlyafter) Backup files only after specified date/time  
-vss Force using VSS (Volume Shadow Copy Service) yes, no(default)
-sharerw Use share read/write mode on errors. Can help if file is open in share read/write mode yes, no(default)

Setting restore options (restore):

Use the following command to find more details:

cbb.exe restore ?

Parameter Description Value
-a(ccount) Account name  
-f(ile) Restore file  
-d(irectory) Restore directory  
-rl Restore location original (default), "path"
-rt Restore type latest (default), Date time
-o(verwrite) Overwrite existing files  
-ep Encryption password  
-bp Backup prefix  
-rn (-restorenew) Restore only new files. Existing files will be overwritten only if modification date of backuped file is newer than existing  

Delete files/folders from cloud (delete):

Use the following command to find more details:

cbb.exe delete ?

Parameter Description Value
-a(ccount) Account name  
-f(ile) Restore file  
-d(irectory) Restore directory  

View files versions (list):

Use the following command to find more details:

cbb.exe list ?

Parameter Description Value
-a(ccount) Account name  
-f(ile) Restore file  
-d(irectory) Restore directory  

Plans listing (plan -l):

Lists all available plans (name and id):

cbb.exe plan -l

Accounts listing (account -l):

Lists all available accounts:

cbb.exe account -l

Synchronize account (account -s):

Sync local database with a cloud storage:

cbb.exe account -s "accountname"

Managing Accounts

Create account (addAccount):

Use the following command to find more details:

cbb.exe addAccount ?

Parameter Description Value
-d Display name  
-st storageType: Type of storage account AmazonS3, Azure, FileSystem, Google, Scality, Dunkel, Tiscali, HostEurope, DreamObjects, Seeweb, Connectria, Walrus, Mezeo, OpenStack, Rackspace, Clodo, HPCloud, HaylixCloud, GreenQloud
-as [authService] : Authentication Service. Used only for OpenStack storage. yes, no(default)
-at [accountType] : Account Type UK, US
-ac Access key or 'account' (Azure), or 'Query ID' (Walrus). Not used for File Storage  
-sk Secret key or 'Shared key' (Azure). Not for File Storage  
-sp Service point (optional). Not used for Amazon S3, Azure, File System, Google  
-c Bucket or Container (Azure) or Path (file storage). Must exist
-bp Bucket prefix (optional) Computer name (default)
-ssl Use SSL yes, no (default)

Edit account (editAccount):

You can rename account, edit storage credentials, change bucket/container or backup prefix, manage SSL option.

Rename account:

cbb.exe editAccount -d "my" -n "join"

Edit storage credentials (e.g. for Amazon S3):

cbb.exe editAccount -d "my" -ac "newAccessKey" -sk "newSecretKey"

(where "newAccessKey" and "newSercetKey" are new access and secret Amazon S3 keys accordingly)

Use the following command to find more details:

cbb.exe editAccount ?

Delete account (deleteAccount):

cbb.exe deleteAccount accountName [, accountName]

Managing Backup Plans

Create file-level backup plan (addBackupPlan):

Use the following command to find more details:

cbb.exe addBackupPlan ?

Parameter Description Value
-n(ame) Plan name  
-a(ccount) Account name  
-aid Account ID  
-f(ile) Backup file  
-d(irectory) Backup directory  
-s(imple) Use simple mode yes, no (default)
-ifm Include file mask  
-efm Exclude file mask  
-es Except system and hidden files yes(default),no
-c Compress files yes,no(default)
-ea Encryption algorithm no,aes128,des64,rc240,3des112,...
-ep Encryption password  
-rrs Use reduced redundancy storage yes,no(default)
-oa(onlyafter) Backup files only after specified date/time  
-every Recurring schedule type day, week, month, dayofmonth
-at Specific datetime of time of schedule "datetime" or "time"
-day Specific day for "dayofmonth" schedule 1..31
-weekday Days of week for "weekly" schedule List of weel days (e.g. "su,mo,tu,we,th,fr,sa")
-weeknumber Number of week for monthly schedule first,second,third,fourth,penultimate,last
plan -r "planname" Run backup plan "planname" now Example: cbb.exe plan -r "DefaultPlan"
-vss Force using VSS (Volume Shadow Copy Service) yes, no(default)
-sharerw Use share read/write mode on errors. Can help if file is open in share read/write mode yes, no(default)
-skipf Skip folders Example: -skipfolder "bin;*temp*;My*"
-df Delete files that have been deleted locally after specified number of days days
-preAction Specify command to be executed before backup completes command
-pac Specify to continue backup plan if pre-backup action failed yes, no
-postAction Specify command to be executed after backup has been successfully completed command
-paa Specify to execute post-backup action in any case (regardless the backup result) yes, no
-notification Specify to recieve notification email when backup fails (errorOnly) or in all cases (on) errorOnly, on, off
-dr Specify to generate detailed report yes, no
-winLog Specify to add entry to Windows Event Log when backup fails (errorOnly) or in all cases (on) errorOnly, on off
-sp Save backup plan configuration to the backup storage yes(default), no

Edit file-level backup plan (editBackupPlan)

Use the following command to find more details:

cbb.exe editBackupPlan ?

Renaming a backup plan:

cbb.exe editBackupPlan -n "Documents" -nn "Work Documents"

Disabling a schedule:

cbb.exe editBackupPlan -n "Work Documents" -sd

Create MS SQL Server backup plan (addBackupMsSqlPlan)

Use the following command to find more details:

cbb.exe addBackupMsSqlPlan ?

Example: Creating a backup plan for "AdventureWorks" and "AdventureWorks2008" databases that runs a Full backup with compression, every work day at 23:00 using SQL authentication:

cbb.exe addBackupMsSqlPlan -n "Backup MS SQL databases" -a mssql_backup -instancename "SQL2008" -username sa -password "qwerty" -winauth no -dbselectiontype Selected -databases "AdventureWorks;AdventureWorks2008" -c yes -every week -at "23:00" -weekday "mo, tu, we, th, fr"

Specific parameters for MS SQL Server backup plan:

1. SQL Server instance name:

-instance "Name" (e.g. "Computer\NamedInstance")

2. Authentication:

SQL Authentication:

-username "SqlUserName" -password "SqlPassword"

Windows Authentication

-winauth no|yes

3. Databases:

-dbselectiontype All|User|Selected

For "Selected" type you need to specify a list of databases using -databases parameter (e.g. -databases "AdventureWorks;AdventureWorks2008")

4. Copy-only backup

-copyonly no|yes (by default "no")

5. Verify backup

-verify no|yes (by default "no")

6. Scheduling full, differential, transaction log backups

Full backup: -every|-at|-occurs (see related option in "How to define specific schedules for file-level backup/restore")

Differential backup: -everyDiff|-atDiff|-occursDiff with related options -dayDiff, -weekdayDiff, -weeknumberDiff, dailyFromDiff, dailyTillDiff, occurValueDiff

Transaction log backup: -everyTLog|-atTLog|-occursTLog with related options -dayTLog, -weekdayTLog, -weeknumberTLog, dailyFromTLog, dailyTillTLog, occurValueTLog

Edit MS SQL Server backup plan (editBackupMsSqlPlan)

Use the following command to find more details:

cbb.exe editBackupMsSqlPlan ?

How to define specific schedules for file-level backup/restore

Specific date:

-at "datetime"

Recurring daily:

-every day -at "time"

Recurring weekly:

-every week -weekday "sa,su" -at "time"

Recurring monthly:

-every month -weeknumber first -weekday "su" -at "time"

Recurring day of month:

-every dayofmonth 7 -at "time"

Create MS SQL Server restore plan (addRestoreMsSqlPlan)

Use the following command to find more details:

cbb.exe addRestoreMsSqlPlan ?

Example: Creating a plan for restoring "AdventureWorks" database to the same database on the original SQL Server instance (using SQL authentication):

cbb.exe addRestoreMSSQLPlan -n "Restore MS SQL database" -a mssql_backup -instancename "SQL2008" -username sa -password "qwerty" -winauth no -dbin "SQL2008" -dbn "AdventureWorks" -dbnn "AdventureWorks" -ov yes

Specific parameters for MS SQL Server restore plan:

1. SQL Server data and log directories that will be used for restored database:

-dp "DataPath" -lp "LogPath"

2. SQL database filename for restoring - you can use a %DATABASENAME% macros that will automatically use an original database name to generate the database filename (e.g. %DATABASENAME%_restored):

-fm "FileName"

3. Overwriting existing database files:

-ov yes | no

4. Closing existing database connections before the restore:

-cc yes | no

5. Specifying a databases name to restore as:

-dbin "InstanceName" -dbn "DatabaseName" -dbnn "NewDatabaseName"

Example: restoring the "AdventureWorks" database as "AdventureWorks_restored"

-dbin "SQL2008" -dbn "AdventureWorks" -dbnn "AdventureWorks_restored"

Run backup plan

cbb.exe plan -r "planname"

Delete backup plan (deleteBackupPlan)

cbb.exe deleteBackupPlan -n "Work Documents"

View backup plan settings (getBackupPlanDetails)

cbb.exe getBackupPlanDetails -n "Work Documents"

or

cbb.exe getBackupPlanDetails -id planID

Notification Settings (notificationSettings)

Email address to receive notification email when backup completes

cbb.exe notificationSettings -email your@email

where -username is optional.

Name of user (optional)

cbb.exe notificationSettings -username nameofuser

Specify to use own SMTP server for email notifications

cbb.exe notificationSettings -usesmtp yes/no

Specify SMTP Server address

cbb.exe notificationSettings -server serveraddress

Specify SMTP Server port

cbb.exe notificationSettings -port serverport

Specify Email From

cbb.exe notificationSettings -emailfrom from@email

Use SSL

cbb.exe notificationSettings -usessl

SMTP requires authentication

cbb.exe notificationSettings -smtpauth yes/no

Specify SMTP user name if SMTP Server requires authentication

cbb.exe notificationSettings -smtpUser username

Specify password if SMTP Server requires authentication

cbb.exe notificationSettings -smtppassword password

Make bootable drive (createrecovery)

Command help

cbb.exe createrecovery ?

To create a password-protected bootable USB

cbb.exe createrecovery -d "F:" -p "qwerty"

To create a password-protected ISO file

cbb.exe createrecovery -d "D:\Temp\win2008s.iso" -iso -p "qwerty"

License command:

Activate license (activateLicense)

Use the following command to find more details:

cbb.exe activateLicense ?

Parameter Description Value
-e(mail) Email for license activation  
-k(ey) License Key  
-t(rial) Request trial  

Show license (showLicense):

cbb.exe showLicense

Release license (releaseLicense):

cbb.exe releaseLicense

Send log (sendLog):

Use the following command to find more details:

Send log (sendLog):

cbb.exe sendLog ?

Parameter Description Value
-u Name (optional)  
-e Email  
-m Description of the issue  

Upgrading to a new version (checkNewVersion):

Use the following command to find more details:

cbb.exe checkNewVersion ?

Automatically upgrade to a new version:

cbb.exe checkNewVersion -i

Integrated help usage:

General Command help:

cbb.exe or cbb.exe -?

Command help:

cbb.exe command ?

Shrink repository database (database):

Use the following command to shrink repository database:

cbb.exe database -shrink