We are in the process of running system maintenance and website optimization and I’ve been playing around with the System Integrity Scripts on my dev server.
The scripts require to run as root user and in my case www-data (Debain 9 / Apache). Some of the scripts run fine e.g system_integrity_check_indexes.php however the system_integrity_clean_cache_dir.php throws up a permission warning. Here is the code and warning I get:
sudo -u www-data php system_integrity_clean_cache_dir.php /var/www/squiz_matrix
Warning: Please make sure you have the correct permission to remove cache files.
SQ_CACHE_PATH is '/var/www/squiz_matrix/cache'
I have checked the /cache directory and the sess_xxxxxx files are all 775 permissions.
What could I be doing wrong? and is this something that can be offloaded to run from Matrix or Crontab instead?
Many thanks.