Command Line Manual : cbackup


The cbackup command is the main command for CubeBackup. This command can be used to check the version number, migrate backup data to another location, reset the administrator of the CubeBackup console, etc.

The cbackup command must be run on the backup server.
The cbackup file is located in the <cubebackup installation directory>/bin folder.

On Windows, cbackup.exe is located in C:\Program Files\CubeBackup4\bin by default.
On Linux, cbackup is located in /opt/cubebackup/bin by default.

SYNOPSIS

cbackup <command> [option]

COMMANDS

The following commands can be used by cbackup.

archive: Archive a user’s data to a specified storage
migration: Migrate backup data to a new location
removeDomain: Remove a domain from CubeBackup
setConsoleAdminEmail: Change admin email of the CubeBackup web console
setDomainAdminEmail: Change domain admin email to reflect a change of administrator made in the G Suite domain.
syncDataIndex: Manually merge the data index to the backup data.
version: Display CubeBackup version.

NOTE:

[Important!] The migration, removeDomain, setConsoleAdminEmail, setDomainAdminEmail, syncDataIndex commands all require Administrator/root privilege.

If CubeBackup runs on a Windows machine, please run these commands as an administrator.
If CubeBackup runs on a Linux server, please use “sudo cbackup <command>” in a bash shell.

cbackup archive

The cbackup archive command allows you to archive a user’s data to a location of your choice. This is especially useful when an employee has left your organization and you would like to keep an archive of his data for possible future use.

SYNOPSIS

cbackup archive <domain name> <user email or shared drive id> <app> <destination path>
  • domain name: the name of your domain (e.g. mycompany.com)
  • user email/shared drive id: the user account you wish to archive (e.g. someone@mycompany.com), or a shared drive ID (e.g. AAGFI5-SlBKnUk9PV)
  • app: must be one of these values: all, gmail, drive, calendar, contacts, sites. Choose all to archive all G Suite data for this user.
  • destination path: The output directory. This can be a local directory or a location on your network.

TIP: If you want to compress the archive data to a ZIP file, you can also specify the name of the ZIP file as the destination path. For example:

cbackup archive mycompany.com  someone@mycompany.com all  /var/archive/cube.zip

will archive all data of user someone@mycompany.com into the cube.zip file instead of exporting all files into a directory.

NOTE: This command requires special privilege.
On Windows, it must be run by an Administrator account.
On Linux, it must be run by the cbuser account.

If CubeBackup runs on Windows, please run this command as an administrator.
If CubeBackup runs on Linux, please use “sudo -u cbuser …” in a bash shell.

EXAMPLES

Suppose you want to archive all G Suite data for user abc@companydomain.com to a directory named archive_data. (The directory can be located on a local disk or on your network.)

For Windows Users

  1. Login to the backup server.
  2. Open a Windows Powershell or Windows Command Prompt using an Administrator account.
  3. In the <cubebackup installation folder>/bin directory, run the command:

    cbackup archive companydomain.com  abc@companydomain.com all f:\archive_data
    

For Linux Users

  1. SSH into the backup server.
  2. Make sure cbuser has write permission to the target directory. One way to do this is to change the owner of the target directory to cbuser.

    sudo chown cbuser:cbuser  /mnt/archive_data
    
  3. In a bash shell, run the command:

    sudo -u cbuser cbackup archive companydomain.com  abc@companydomain.com all  /mnt/archive_data
    

cbackup migration

The cbackup migration command allows you to migrate your current backup data to a new location. This can be useful if your current storage is full or if you wish to change to a different storage type. For example, you can move your backups from a local disk to AWS S3 storage, or from AWS S3 to a NAS inside your organization.

SYNOPSIS

  • Migrate current backup data to a new local directory:

    cbackup migration [-dataIndexPath=<new Index Path>] local <local destination path>
    
  • Migrate current backup data to an Amazon S3 bucket:

    cbackup migration [-dataIndexPath=<new Index Path>] s3 <s3 destination bucket> <access key id> <secret access key>
    
  • Migrate current backup data to mounted network storage (Linux)

    cbackup migration [-dataIndexPath=<new Index Path>] nas <mounted network storage path>
    
  • Migrate current backup data to network storage (Windows)

    cbackup migration [-dataIndexPath=<new Index Path>] wins <windows network destination path> <username> [password]
    

OPTIONS:

  • -dataIndexPath: Specify a new local directory for the data index path.
    If this option is not specified, CubeBackup will not migrate the data index, but keep it where it is. In most cases, there is no need to specify a new path for the data index.

For detailed instructions and examples on how to use cbackup migration, please refer to How to migrate G Suite backup data to a new location?

cbackup removeDomain

Many G Suite administrators and G Suite partners back up multiple G Suite domains using CubeBackup. The cbackup removeDomain command can be used to remove a G Suite domain from the backup list.

SYNOPSIS

cbackup removeDomain <domain name>

NOTE:

  • The cbackup removeDomain command removes only the domain (not the backup data) from CubeBackup. That is, CubeBackup will no longer back up the specified domain, but the backup data for this domain remains completely untouched.
  • If a restore request comes up for this domain after it has been removed, you can add this G Suite domain again and the backups for this domain will once again show up in the RESTORE page.
  • Please do NOT use this command if you only have one G Suite domain in CubeBackup. Removing the sole domain will crash CubeBackup.
  • This command requires Administrator/root privilege.

    If CubeBackup runs on Windows, please run this command as an administrator.
    If CubeBackup runs on Linux, please use “*sudo …*” in the bash shell.

For detailed instructions on how to use this command, please refer to How to remove a G Suite domain from CubeBackup?

cbackup setConsoleAdminEmail

The cbackup setConsoleAdminEmail command allows you to assign a new administrator for CubeBackup. The email address entered here also functions as the console login.

SYNOPSIS

cbackup setConsoleAdminEmail <admin email> 

After the command has executed, you will be asked to enter a new administrator password.
Once the email and password have been set, you will be able to open the CubeBackup web console and login using these new credentials.

NOTE:

  • This command requires Administrator/root privilege.

    If CubeBackup runs on Windows, please run this command as an administrator.
    If CubeBackup runs on Linux, please use “sudo …” in the bash shell.

  • This command is used to change the login account of the CubeBackup console and has nothing to do with changing the administrator of your G Suite domain. If the administrator account has been changed in your G Suite domain, please use the command cbackup setDomainAdminEmail to update the domain administrator in CubeBackup.

cbackup setDomainAdminEmail

CubeBackup relies on the correct G Suite domain administrator account for domain-wide OAuth authentication. If the administrator of your G Suite domain has been changed, all Google API requests will fail and CubeBackup will no longer work until it has been updated with the new G Suite domain administrator information.

SYNOPSIS

cbackup setDomainAdminEmail <domain name> <new admin email>

NOTE:

  • This command requires Administrator/root privilege.

    If CubeBackup runs on Linux, please use “sudo …” in the bash shell.
    If CubeBackup runs on Windows, please run this command as an administrator.

  • After updating CubeBackup with the new G Suite domain administrator email, you need to restart the CubeBackup service in order for the changes to take effect.

    If CubeBackup is installed on Linux, run this command in the bash shell:

    sudo /opt/cubebackup/cbsrv restart
    

    If CubeBackup is installed on Windows, enter services.msc in the command line, then in the Services list that pops up, right-click the CubeBackup entry, and select Restart.

EXAMPLES

Suppose your G Suite domain administrator has been replaced and the new administrator’s email is abc@companydomain.com. All Google API requests will fail until CubeBackup is updated with the new administrator’s information using the command cbackup setDomainAdminEmail.

For Windows Users

  1. Login to the backup server.
  2. Open a Windows Powershell or Windows Command Prompt using an Administrator account.
  3. In the <cubebackup installation folder>/bin directory, run the command:

    cbackup setDomainAdminEmail  companydomain.com  abc@companydomain.com
    
  4. Restart the CubeBackup service

Enter services.msc in the command line, then in the Services list that pops-up, right-click the CubeBackup entry, and select Restart.

For Linux Users

  1. SSH into the backup server.
  2. In a bash shell, run the command:

    sudo /opt/cubebackup/bin/cbackup setDomainAdminEmail companydomain.com  abc@companydomain.com
    
  3. Restart the CubeBackup service

    sudo /opt/cubebackup/bin/cbsrv restart
    

cbackup syncDataIndex

The cbackup syncDataIndex command manually merges all index data to the backup data. This command is only used under special circumstances.

SYNOPSIS

cbackup syncDataIndex

NOTE: This command requires special privilege.
On Windows, it must be run by the Administrator account.
On Linux, it must be run by the cbuser account.

For an example of using this command, please visit How to move the data index to another location?

cbackup version

This command will display the current version of CubeBackup.

SYNOPSIS

cbackup version