The backups_create_metadata Script

Valid for versions 82 through the latest version

Version:

82


Last modified: May 13, 2020

Overview

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

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

Run the 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

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

Options Description Example
--all Creates metadata files for all backups.
Note:
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 for corrupt files, then repairs them.
Combine this option with the --schedule_rebuild option to rebuild the 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 rebuild the 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.
Note:
  • 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