How to remove large unnecessary files from backup storage in order to save space


When you back up Google Workspace data using CubeBackup, the size of the backup can easily balloon, especially for large organizations. For example, one employee might upload many large unimportant videos to his Google Drive, or another may keep different copies of his VM images or Mac Time machine backups in Google Drive. These files can consume a large amount of space in your backup storage.

CubeBackup allows you to filter out these large unnecessary files from your backups based on your own customized rules. Using CubeBackup, you can set file exclusion rules before the first backup starts to prevent certain files from ever being backed up. You can also use these exclusion rules to remove unnecessary files from the backup storage at a later date.

Prevent files from being backed up before the start of the first backup

After installing CubeBackup on your server and setting it up by following the initial configuration instructions, you can log into the CubeBackup web console and add your file exclusion rules before the first backup starts.

  1. In the CubeBackup console, select SETTINGS, and then in the Apps section click *Options at the right of the Drive switch.

  2. In the filter dialog that pops up, you can add multiple file exclusion rules. For a detailed explanation and examples of the exclusion rules, please refer to File Exclusion Rules.

NOTE:

  1. CubeBackup employs an incremental backup algorithm. If a file was skipped due to your file exclusion rule settings, it will not be backed up again even after you remove the exclusion rules, unless:

    (a) A change is made to the file, either to its name, content, permissions, or path.

    (b) You start the whole backup from scratch again.

    So, please construct your file exclusion rules carefully so that they will not exclude any useful files from being backed up.

  2. Once a backup has been started, changes to the exclusion rules will only take effect after the current backup has completed. That is, they will apply to all subsequent backups, but not to the currently running backup.
  3. If you are unsure whether certain files need to be excluded in the backup, or you are concerned that important files may be mistakenly excluded, it is safer to leave the exclusion rules empty. You can still remove unwanted files after the initial backup is completed.

Remove unimportant files from the backup data

It is not absolutely necessary to set up the file exclusion rules before the first backup. In most cases, administrators may find unnecessary files after backups have already been performed. Don’t worry, CubeBackup can still remove these files based on your exclusion rules to free up disk space or cloud storage.

To purge files from backups using file exclusion rules:

  1. Log into the CubeBackup console, add the exclusion rules in the SETTINGS > Apps > Options dialog, then click the “Update settings” button. For detailed information on how to write the file exclusion rules, see File exclusion explanation and examples.
  2. After the file exclusion rules have been set, log (or SSH) into the CubeBackup server, and run the cbackup filesExclude list command to list all files that match your exclusion rules.

    cbackup filesExclude list <domain name>

    NOTE : This command requires special privileges

    On Windows, it must be run by an Administrator account.

    On Linux, it must be run by the cbuser account. For example:

    sudo -u cbuser /opt/cubebackup/bin/cbackup filesExclude list mydomain.com

  3. The cbackup filesExclude list command does not actually purge any files from the server and the exclusion rules apply only to future backups, so it is safe to modify the exclusion rules as many times as you like, and run this command to check which files would be filtered until you are satisfied.
  4. In the CubeBackup console, stop the backup job if one is running.
  5. Log into the backup server, and stop the CubeBackup service.

    On Linux:

       sudo /opt/cubebackup/bin/cbsrv stop

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

  6. Run the cbackup filesExclude remove command to purge files from the backup data.

    cbakup filesExclude remove <domain name>

    NOTE:This command requires special privileges.

    On Windows, it must be run by an Administrator account.

    On Linux, it must be run by the cbuser account. For example:

        sudo -u cbuser /opt/cubebackup/bin/cbackup filesExclude remove mydomain.com

  7. In the CubeBackup console, you will now see that the storage status information on the OVERVIEW page has updated.

    NOTE: After the unwanted files have been purged from your backups, please do not remove these file exclusion rules from the SETTINGS > Apps > Options dialog. Otherwise, CubeBackup will re-download the files again when they are changed in any way (content, name of file, path, date, etc.).