Command Line Interface for CloudBerry Backup

Introduction

CloudBerry Backup command line interface allows to back up and restore files to/from cloud storage, edit global options, list backup plans and accounts, 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 command line console - cmd.exe. Make sure you change your current folder to CloudBerry Backup product installation folder (C:\Program Files\CloudBerryLab\CloudBerry Backup\):

  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"

Examples show 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

Activating CloudBerry Backup

Activate product or request trial

  1. Activate a commercial license (Email, key are required):cbb activatelicense -e "email" -k "license_key" -or

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

  2. Request trial license for a certain edition (Email, edition are required):cbb activatelicense -e "email" -edition "ultimate" -t

    (where -edition can be desktop, server, mssql, msexchange, ultimate)

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.
  3. Activate license keycbb activatelicense -e "email" -k "license_key" -oa "activationkey_received"

    Note: 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"

You can also request trial using offline:

cbb activatelicense -e "email" -edition "ultimate" -t -or

As an output you will get a service key. Then run the command:

cbb activatelicense -e "email" -edition "ultimate" -oa "activationkey_received"

License commands (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
-edition Product edition (required for requesting trial) desktop, server, mssql, msexchange, ultimate
-or Offline request for getting activation key
-oa Offline activation request

Show license (showLicense):

cbb.exe showLicense

Release license (releaseLicense):

cbb.exe releaseLicense

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, Glacier, S3Compatible, Scality, Dunkel, Tiscali, HostEurope, DreamObjects, Seeweb, Connectria, Walrus, OpenStack, Rackspace, Clodo, HPCloud, HPHelion, IDCFrontier, GreenQloud
-as [authService] : Authentication Service. Used only for OpenStack storage. yes, no(default)
-at [accountType] : Account Type. Used only for Rackspace storage. UK, US
-ac Access key or 'account' (Azure), or 'Query ID' (Walrus) or ‘User Name’ for OpenStack, Rackspace, Clodo, HPCloud. Not used for File Storage
-sk Secret key or 'Shared key' (Azure), or ‘Api key’ (OpenStack). Not for File Storage
-sp Service point (optional). Not used for Amazon S3, Azure, File System, Google, OpenStack, Rackspace, Clodo, HPCloud.
-c Bucket or Container (Azure, OpenStack, Rackspace, Clodo, HPCloud) 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]

List accounts (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"

Sync local database with a cloud storage if the “encrypt filenames” option was used for backup:

cbb.exe account -s "accountname" -syncpassword "password"

Sync local database with a cloud storage for “custom mode” backups:

cbb.exe account -s "accountname" -customfolders "foldername"

Operations with Files

Backup files (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
-skipf Skip folders. Example: “bin;*temp*”
-c Compress files yes,no(default)
-ea Encryption algorithm no,aes128,des64,rc240,3des112,..
-ep Encryption password
-bef Backup empty folders yes,no(default)
-rrs Use reduced redundancy storage (for Amazon S3 only) yes,no(default)
-sse Use server-side encryption (for Amazon S3 only) yes,no(default)
-sia Use Standard-Infrequent Access (for Amazon S3 only) 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)

Restore files (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

Managing Plans

File-level plans

Create 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)
-custom Use custom mode. Custom path should be specified.
-ifm Include file mask
-efm Exclude file mask
-es Except system and hidden files yes(default), no
-bef Backup empty folders yes, no(default)
-ea Encryption algorithm No, aes128,des64,rc240,3des112,...
-ep Encryption password
-rrs Use reduced redundancy storage (for Amazon S3 only) yes, no(default)
-sse Use server-side encryption (for Amazon S3 only) yes, no(default)
-sia Use Standard-Infrequent Access (for Amazon S3 only) yes, no(default)
-oa(onlyafter) Backup files only after specified date/time
-purge Purge versions that are older than a period (except the lastest version)
-keep Keep limited number of versions all, “number”
-keepLastVersion Always keep the last version. yes, no
-delayPurge Specify purge delay. No, 1d(w,m)
-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 receive 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
-cloneplan Clone existing plan. Plan name should be specified.
Schedule Options
-every Recurring schedule type day, week, month, dayofmonth, real-time
-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 weekdays (e.g. "su,mo,tu,we,th,fr,sa")
-weeknumber Number of week for monthly schedule first,second,third,fourth,penultimate,last
dailyFrom Specify daily recurring “from” time
dailyTill Specify daily recurring “till” time
-occurs Specify recurring period type. hour, min
-occurValue Specify recurring period value
-everyForce Specify recurring type for force incremental backup day, week, month, dayofmonth, real-time
-atForce Specify datetime or time of schedule for force incremental backup "datetime" or "time"
-dayForce Specify day for “dayofmonth” schedule 1..31
-weekdayForce Specify days(s) of week for weekly schedule for force incremental backup. List of weekdays (e.g. "su,mo,tu,we,th,fr,sa")
-dailyFromForce Specify daily recurring “from” time
-dailyTillForce Specify daily recurring “till” time
-occursForce Specify recurring period type. hour, min
-occurValueForce Specify recurring period value

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"

Edit 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

MS SQL Server plans

Create 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 backup plan (editBackupMsSqlPlan)

Use the following command to find more details:

cbb.exe editBackupMsSqlPlan ?

Create 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"

Image-based plans

Create backup plan (addBackupIBBPlan)

Use the following command to find more details:

cbb.exe addBackupIBBPlan ?

Example: Creating an image-based backup plan for backing up system required volumes to an external drive (i.e. files system account called fileSsytemConnectionName) with compression every friday at 23:00:

cbb.exe addBackupIBBPlan -n "Backup system required volumes" -a fileSystemConnectionName -r -disableVSS -c yes-every week -at "23:00" -weekday "fr"

Specific parameters for MS SQL Server backup plan:

Specifying what volumes to back up:

  • -r – only system required volumes
  • -av – all volumes
  • -v "volumeID" – specified volume(s)
  • -ignoreBadSectors – allows to ignore bad sectors. Values: yes (default), no

Using VSS:

  • -disableVSS – allows to use a direct access to NTFS volume. Values: yes, no (default)
  • -useSystemVSS – allows to use system VSS provider. Values: yes, no (default)

Manage blocks for block-level backup:

  • -useBlockLevelBackup – enables block-level backup. Values: yes (default), no
  • -blockSize – defines a block size (KB). Values: 128, 256, 512, 1024 (default)

Edit backup plan (editBackupIBBPlan)

Use the following command to find more details:

cbb.exe editBackupIBBPlan ?

Create restore plan (addIBBRestorePlan)

Use the following syntax to find more details:

cbb addIBBRestorePlan ?

Example: Here is sample command to restore the image copy:

  1. named RestoreIBBPlanFromCLI
  2. restores all volumes from the latest backup
  3. of disk specified by diskFromBackup parameter as VHD virtual disk
  4. to folder D:\restoreTarget
cbb <b>addIBBRestorePlan -n RestoreIBBPlanFromCLI -a fileSystemConnection</b> -rt LatestVersion -av <b>-vdt \"Hyper-V Virtual Disk (VHD-format) fixed"</b> -diskFromBackup 00000000-0000-0000-0000-000000000000 -vdn RestoredVirtualDisk -vdf d:\restoreTarget\

Specific parameters for image-based restore plan:

  1. Physical or virtual target:

    -pd(-physicalDisk) Restore to physical disk specified by Id. You can list existing disks using cbb listDiskVolumes command.

    -pv(-physicalVolume) Restore to volume specified by id. You can list existing volumes using cbb listDiskVolumes command.

    -vdt(-virtualDiskType) Restore to virtual disk. You need to specify one of the types:

    • RAW disk image
    • VirtualBox Virtual Disk fixed
    • VirtualBox Virtual Disk dynamic
    • Hyper-V Virtual Disk (VHDX-format) dynamic
    • Hyper-V Virtual Disk (VHD-format) fixed
    • Hyper-V Virtual Disk (VHD-format) dynamic
    • VMware Virtual Disk vmfsfixed
    • VMware Virtual Disk vmfsdynamic

    -vdn(-virtualDiskName) Set target virtual disk name

    -vdf(-virtualDiskFolder) Set target virtual disk destination folder

  2. Source drive:

    -did(-diskId,-diskFromBackup) Backed up disk id. You can list backed up disks using cbb listIBBContent command.

    -av(-allVolumes) Restore all volumes.

    -v(-selectedVolume) Restore volume by id. It is WindowsVolumeIdentity from the result of the cbb listIBBContent command.

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"

Common operations

List plans (plan -l):

Lists all available plans (name and id):

cbb.exe plan -l

Run / Stop plan (plan -r, plan -s)

To run a certain plan, run the command:

cbb.exe plan -r "planname"

To stop a particular plan, run the command:

cbb.exe plan -s "planname"

Delete plan (deleteBackupPlan)

To delete a certain plan, run the command:

cbb.exe deleteBackupPlan -n "Work Documents"

View plan settings (getBackupPlanDetails)

cbb.exe getBackupPlanDetails -n "Work Documents"orcbb.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

Configuration Commands

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.

Shrink repository database (database)

Use the following command to shrink repository database:

cbb.exe database -shrink

Switching to All Users mode

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
-delayPurge Allows to delay purge for a certain period. no, 1d(w,m) where d=days, w=weeks, m=months
-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)

Troubleshooting

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

Save log (saveLog):

Use the following command to find more details:

Save log (saveLog):

cbb.exe saveLog ?
Parameter Description Value
-p Target path for saving logs

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:

Use the following command to find more details:

cbb.exe checkNewVersion ?

Automatically upgrade to a new version:

cbb.exe checkNewVersion -i