File integrity checking

ResourceSpace includes a tool to verify the file integrity of primary resource files, allowing you to be notified should any corruption occur and take remedial action as necessary.

Configuring the file integrity check

To configure the system to check file integrity you need to have the following configured

  • Full file checksums (set the following options)
    $file_checksums     = true;
    $file_checksums_50k = false;
    $file_checksums_offline = false;*
    * If $file_checksums_offline is true then /pages/tools/update_checksums.php must be run regularly
  • The ResourceSpace cron script configured to run frequently as a cron task (Linux) or scheduled task (Windows). This can safely be run more frequently than daily.
  • You then have to enable the following configuration option to set the hours between which the script will run:
    # $file_integrity_verify_window = array(22,6);	# between 10PM and 6AM 
    # $file_integrity_verify_window = array(18,0);  # between 6PM and 12AM (midnight)
    $file_integrity_verify_window = array(0,0);     # Off by default

Running the file integrity check

The integrity check script will be started whenever the cron script is run and will check all primary resource files that have not been verified in the last 24 hours or that have never been verified.

The system will continue to perform file integrity checks until all have been completed, as long as it is within the configured time window.

When the script has finished, ResourceSpace will send a notification message to the system administrators if any resources have failed, who can then take action as necessary to resolve the situation e.g. restore files from backups.

* This message will only be sent to system administrators that have the option to receive system notifications set in their user preferences and will not be sent more than once a day.

Search for resources with file integrity failures

Running the special search '!integrityfail' will show you all resources that have failed the last integrity check.

The stored checksums can be downloaded and viewed by choosing the 'CSV export - metadata' option for any set of search results and selecting the 'Include data from all accessible fields' option. This can be useful for large migrations to ensure that file integrity has been maintained throughout. All that is required is to compare the ResourceSpace generated checksums with those generated from the original files using a third party checksum tool or script.