Overview

The /usr/local/cpanel/scripts/backups_create_metadata script allows a user to create metadata files for all account backup types.

The script will generate metadata for all directories under the /home/username directory, except for the /mail and /.cpanel directories.

The backups_create_metadata script

To use the /usr/local/cpanel/scripts/backups_create_metadata script, run the following command as the root user:

/usr/local/cpanel/scripts/backups_create_metadata

Options

You must provide at least one option to execute this script.

Use the following options for the /usr/local/cpanel/scripts/backups_create_metadata script:

OptionsDescriptionExample
--all

Creates metadata files for all backups.

You cannot combine the --all option with other options.


/scripts/backups_create_metadata --all
--backup=[backup filename]

Creates metadata files for the specified backup file.

Combine this option with the --user option to create metadata for the specified user in the specified backup directory.

  • /scripts/backups_create_metadata --backup=monthly/YYYY-DD-MM
  • /scripts/backups_create_metadata --backup=monthly/YYYY-DD-MM --user=username
--fix_corrupt

Scans the metadata databases in search of corrupt files, then repairs them.

Combine this option with the --schedule_rebuild option to identify and rebuild corrupt metadata in a background task.

  • /scripts/backups_create_metadata --fix_corrupt
  • /scripts/backups_create_metadata --fix_corrupt --schedule_rebuild
--schedule_rebuild

Same as the --all option, but runs the script in the background.

Combine this option with the --fix_corrupt option to identify and rebuild corrupt metadata in a background task.

  • /scripts/backups_create_metadata --schedule_rebuild
  • /scripts/backups_create_metadata --schedule_rebuild --fix_corrupt
--user=[user]

Creates metadata files for the specified user.

Combine this option with the --backup=[backup filename] option to create metadata for the specified user in the specified backup directory.

  • /scripts/backups_create_metadata --user=username
  • /scripts/backups_create_metadata --user=username --backup=monthly/YYYY-DD-MM
--vacuum

Defragments the metadata SQL database and frees unused space in a background task.

  • The –vacuum option will only free space if the database has unused space. If you have already used the --vacuum option to free database space, you cannot use it again to clear additional space.
  • You cannot combine the --vacuum option with other options.


/scripts/backups_create_metadata --vacuum

Additional documentation