File integrity checking (9.1 +)

From version 9.1 onwards 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 from version 9.1 onwards
  • 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 sytem 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.