by Séverin Terrier.
Hi Rob,
I don't know or understand why this file becomes empty on your installations, but it shouldn't.
In my opinion, it's not really a Moodle problem, but more a web server problem. For security purposes, Moodle directory (and subdirectories and files) should be read only.
You should look seriously at how are your installation handled, and what can lead to this problem (cli scripts, corruption...). Perhaps looking at the date/time of last modification could also help.
Séverin