I wrote a script which checks the integrity of my static websites by checksumming each file and comparing with the checksums of the corresponding files on my home machine. The script is driven by a text file which contains a list of my static websites, together with the appropriate user names. For example,
For each line of this file, the script logs in as the specified user and runs
where ‘mydomain’ is the specified domain name.
I have two questions:
(1) Obviously the script could be made simpler if it could set an environment variable (’$domain’, for example) instead of having to edit itself at run-time to contain the specified domain name. The message which comes up when it tries to set an environoment variable is “Server refused to set environment variables”. Does Dreamhost disallow setting environment variables?
(2) I have large video files in some of my websites, so maybe I should worry about how many CPU minutes this script is eating up. I suppose I could simply run the script whenever I feel like it and wait to see if anyone complains, but that does not sound sensible. What would be a better approach?