How to remove backups for a specific user or a shared drive


In some situations, you may wish to remove the backup data for a specific user or shared drive. Perhaps a user has left your organization, or you simply wish to free up space by removing a shared drive that is no longer needed.

Remove a specific user

CubeBackup allows you to easily purge specific users from your backup set. Please follow the detailed instructions appropriate for your operating system.

  1. Log into the backup server.

  2. Be sure to stop the CubeBackup service before running this command:

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

  3. Run the cbackup purgeUser command, recheck the user name, and type “yes” to purge all backup data for the specific user.

    cbackup purgeUser <user email>

    Note: This command requires special privilege and must be run by an Administrator account.

  4. After running this command, you will need to restart the CubeBackup service:

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

  5. Now you can log into the CubeBackup console and see that:

    • No files/messages are listed under the user’s account on the RESTORE page.
    • The statistical data on the OVERVIEW page has been refreshed to reflect the changes.
    • The user has now been removed from the backup set and will not be included in future backups.
  1. SSH into the backup server.

  2. Before running this command, be sure to stop the CubeBackup service:

    sudo /opt/cubebackup/bin/cbsrv stop
  3. Run the cbackup purgeUser command, recheck the user name, and type “yes” to purge all backup data for the specific user.

    Note: This command requires special privileges and must be run by the cbuser account.

    sudo -u cbuser /opt/cubebackup/bin/cbackup purgeUser <user email>
  4. After running this command, you will need to restart the CubeBackup service.

    sudo /opt/cubebackup/bin/cbsrv start
  5. Now you can log into the CubeBackup console and see that:

    • No files/messages are listed under the user’s account on the RESTORE page.
    • The statistical data on the OVERVIEW page has been refreshed to reflect the changes.
    • The user has now been removed from the backup set and will not be included in future backups.

The cbackup purgeUser command will remove the backup data of a specific user. However, this command can only work after the CubeBackup service has stopped. This means that you need to stop the docker container before running the command, but that, in turn, makes running the cbackup purgeUser command a bit tricky. Please carefully follow the instructions below to purge the backup data for a specific user from the storage.

  1. Find the container id for CubeBackup:

    docker ps -a
  2. Stop the CubeBackup container:

    docker stop <container_id>
  3. Commit the stopped container into a new image (for example, cube/tmp_img):

    docker commit <container_id> cube/tmp_img

    This command saves the modified container state into a new image.

  4. Start a new docker based on the new temporary image with a bash command.

    Please note that you need to mount the volumes exactly as they were in the original CubeBackup docker container so that the new container can properly access the backup data. For example:

    docker run -ti   \
    -v /var/cubebackup_index:/cubebackup_index \
    -v /var/cubebackup_data:/cubebackup_data \
    --mount source=cube_cfg,target=/opt/cubebackup/etc \
    --mount source=cube_db,target=/opt/cubebackup/db \
    --mount source=cube_log,target=/opt/cubebackup/log \
    cube/tmp_img \
    /bin/bash
  5. Now in the bash shell of the new docker, install the sudo command:

    yum install sudo -y
  6. Run the cbackup purgeUser command in the docker container.

    sudo -u cbuser /opt/cubebackup/bin/cbackup purgeUser  <user_email>

    When prompted, type “yes” to confirm, and CubeBackup will delete the backup data for the specified user. Depending on the size of the user’s data, this process may take quite a while.

  7. After the cbackup purgeUser command has successfully completed, type exit to stop and exit the temporary container.

  8. Restart the original CubeBackup container.

    docker start <container_id>
  9. Now you can log into the CubeBackup console and see that:

    • No files/messages are listed under the user’s account on the RESTORE page.
    • The statistical data on the OVERVIEW page has been refreshed to reflect the changes.
    • The user has now been removed from the backup set and will not be included in future backups.

Remove a specific shared drive

CubeBackup allows you to easily purge specific shared drives from your backup set. Please follow the detailed instructions appropriate for your operating system.

  1. Find the ID of shared drive in the URL of the shared drive’s Restore page. Shared drive ID in the URL

    Note: Please write down the Shared Drive ID or save it in a text file. Later, the backup service will be stopped, and this page will be unavailable.

  2. Log into the backup server.

  3. Be sure to stop the CubeBackup service before running this command:

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

  4. Run the cbackup purgeSharedDrive command to purge all backup data for the specific shared drive.

    cbackup purgeSharedDrive <shared drive id>

    Note: This command requires special privileges and must be run by an Administrator account.

  5. After running this command, you will need to restart the CubeBackup service.

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

  6. Now you can log into the CubeBackup console and see that:

    • No files/messages are listed under the shared drive on the RESTORE page.
    • The statistical data on the OVERVIEW page has been refreshed to reflect the changes.
    • The shared drive has now been removed from the backup set and will not be included in future backups.
  1. Find the ID of shared drive in the URL of the shared drive’s Restore page. Shared drive ID in the URL

    Note: Please write down the Shared Drive ID or save it in a text file. Later, the backup service will be stopped, and this page will be unavailable.

  2. SSH into the backup server.

  3. Before running this command, be sure to stop the CubeBackup service:

    sudo /opt/cubebackup/bin/cbsrv stop
  4. Run the cbackup purgeSharedDrive command to purge all backup data for the specific shared drive.

    Note: This command requires special privileges and must be run by the cbuser account.

    sudo -u cbuser /opt/cubebackup/bin/cbackup purgeSharedDrive <shared drive id>
  5. After running this command, you will need to restart the CubeBackup service.

    sudo /opt/cubebackup/bin/cbsrv start
  6. Now you can log into the CubeBackup console and see that:

    • No files/messages are listed under the shared drive on the RESTORE page.
    • The statistical data on the OVERVIEW page has been refreshed to reflect the changes.
    • The shared drive has now been removed from the backup set and will not be included in future backups.

The cbackup purgeSharedDrive command will remove the backup data of a specific Shared Drive. However, this command can only work after the CubeBackup service has stopped. This means that you need to stop the docker container before running the command, but that, in turn, makes running the cbackup purgeSharedDrive command a bit tricky. Please carefully follow the instructions below to purge the backup data for a specific Shared Drive from the storage.

  1. Find the ID of shared drive in the URL of the shared drive’s Restore page. Shared drive ID in the URL

    Note: Please write down the Shared Drive ID or save it in a text file. Later, the backup service will be stopped, and this page will be unavailable.

  2. Find the container id for CubeBackup:

    docker ps -a
  3. Stop the CubeBackup container:

    docker stop <container_id>
  4. Commit the stopped container into a new image (for example, cube/tmp_img):

    docker commit <container_id> cube/tmp_img

    This command saves the modified container state into a new image.

  5. Start a new docker based on the new temporary image with a bash command.

    Please note that you need to mount the volumes exactly as they were in the original CubeBackup docker container so that the new container can properly access the backup data. For example:

    docker run -ti   \
    -v /var/cubebackup_index:/cubebackup_index \
    -v /var/cubebackup_data:/cubebackup_data \
    --mount source=cube_cfg,target=/opt/cubebackup/etc \
    --mount source=cube_db,target=/opt/cubebackup/db \
    --mount source=cube_log,target=/opt/cubebackup/log \
    cube/tmp_img \
    /bin/bash
  6. Now in the bash shell of the new docker, install the sudo command:

    yum install sudo -y
  7. Run the cbackup purgeSharedDrive command in the docker container.

    sudo -u cbuser /opt/cubebackup/bin/cbackup purgeSharedDrive  <shared_drive_id>

    When prompted, type “yes” to confirm, and CubeBackup will delete the backup data for the specified shared drive. Depending on the size of the shared drive’s data, this process may take quite a while.

  8. After the cbackup purgeSharedDrive command has successfully completed, type exit to stop and exit the temporary container.

  9. Restart the original CubeBackup container.

    docker start <container_id>
  10. Now you can log into the CubeBackup console and see that:

    • No files/messages are listed under the shared drive on the RESTORE page.
    • The statistical data on the OVERVIEW page has been refreshed to reflect the changes.
    • The shared drive has now been removed from the backup set and will not be included in future backups.