Enterprise Administration > File Vaulting and Replication > File Vaulting > Understanding File Vaulting > Windchill Vault Configuration > Maintaining Your Vaults
  
Maintaining Your Vaults
To free up disk space, you may want to perform periodic maintenance on vaults and folders to remove unreferenced files. An unreferenced file is one that no longer has a valid association to a Windchill object. You can remove unreferenced files by doing one of the following:
From the Vault Configuration window, select Object > Remove unreferenced files to perform a one-time cleanup. For details, see Cleaning Up Vaults and Folders.
From a Windchill shell, use the RemoveUnreferencedFiles utility. For details, see RemoveUnreferencedFiles tool below.
You can also use the Object > Define Content Cleanup Rules option to set up an automated cleanup schedule that marks files as unreferenced, and optionally deletes files for replicated items in replica vaults that match criteria you specify.
* 
By default, the automated vault cleanup operation simply unreferences replica vault files that match the cleanup criteria. These files are not deleted until you remove unreferenced files. To automate this process so that files that are unreferenced by the cleanup operation are automatically deleted, set the wt.fv.master.deleteUnreferencedFilesOnAutoVaultCleanup to true in the wt.properties file.
When you remove unreferenced files, they are permanently deleted from the host system. Therefore, you should generate backup information before you perform the cleanup operation. You can do this from the Vault Configuration window by selecting File > Generate Backup Info. When you do this, the Windchill method server writes to the log file identified by the $(wt.fv.log.mountInfoFile) property in the wt.properties file. This file contains file vault mounting information in the following format: <hostname><mount path>.
You can use the backup information file to configure your system backup tool for effective protection of your file vaults. If you are not setting properties through a graphical user interface or in a mapping rules file, you add or edit properties with the xconfmanager utility. For more information, see Using the xconfmanager Utility.
In addition, the following rules govern deletion of vault objects:
When a host with mounts is deleted, all the mounts associated with that host are also removed. Consequently, folders associated with this host are no longer mounted to it, but may remain mounted to other hosts.
You cannot delete a vault that contains folders.
You cannot delete a folder that contains content files.
When a folder is deleted, all of its mounts are also removed.
RemoveUnreferencedFiles Tool
The RemoveUnreferencedFiles tool enables you to clean up unreferenced files from a command-line interface. Only administrator users can run this tool. This tool provides a different way to perform the same functions as the Remove unreferenced files option available from the Vault Configuration window. It is helpful if you want to remove unreferenced files as part of a cron job or batch script.
You run the RemoveUnreferencedFiles tool from a Windchill shell with the following commands:
Windchill wt.fv.tools.RemoveUnreferencedFiles
Windchill wt.fv.tools.RemoveUnreferencedFilesOlderThan
Use this tool with one of the following options:
-move�Moves unreferenced files to a subfolder named .unreferenced in the folder where the content file resides.
-delete�Permanently deletes unreferenced files.
You must include one of the following parameters:
-folder=<foldername>�Name of a master or replica vault folder.
-vault=<vaultname>�Name of a master or replica vault.
When you run this tool, it creates a log file in a subfolder named RemoveUnreferencedFiles in the Windchill log directory. The log includes the following information: the user who ran the tool, input parameters, the start time, the completion time, and any errors that occurred.
Purging Vault Cleanup Audit Logs
If the vault cleanup audit logs become too large, you can use the ContentCleanupLogsUtility tool to extract and purge these logs. The data that is extracted is saved in a ZIP file. This tool can only be run by administrators, and a Windchill instance must be running when the tool is run.
To run this tool, enter the following command in a Windchill shell:
windchill wt.fv.tools.ContentCleanupLogsUtility
You can include any of the following arguments when using this tool. If you do not specify any arguments, logs are extracted at the site level for the last 60 days, and the resulting ZIP file is saved in the following location: <Windchill>\logs.
Argument
Description
-sites=<site1>,<site2>,...
Identifies the sites from which logs will be extracted. If you do not include this argument, logs at all sites will be extracted.
-vaults=<vault1>,<vault2>,...
Identifies the vaults from which logs will be extracted. If you do not include this argument, logs in all vaults will be extracted.
-folders=<folder1>,<folder2>,...
Identifies the folders from which logs will be extracted. If you do not include this argument, logs in all folders will be extracted.
-fromdate=<mm/dd/yyyy>
Only logs created after this date will be extracted. Use this argument with the -todate argument.
-todate=<mm/dd/yyyy>
Only logs created before this date will be extracted. Use this argument with the -fromdate argument.
-path=<path>
The path where the ZIP file that contains the logs will be saved. If you do not include this argument, the file will be saved in the following location: the resulting ZIP file is saved in the following location: <Windchill>\logs
-purge=<true or false>
If set to true, the content cleanup audit logs are removed from the database after they are extracted.
-usage
Lists all the valid arguments and their effects.
When you use this tool, a window appears and requests your user name and password. Be sure that the user whose credentials you enter is a member of the Administrators group.