Make your file Immutable to prevent unwanted overwrite.
chattr +i /your-file-path.txt
It will change your file's attribute. So you can check the attribute using the command below:
lsattr /your-file-path
If ---i---- exist, that means immutable attribute added.
It could save you from some cron job also. Last time I resolved my Nginx configuration overwrite by HestiaCP issue through the approach.
Have a good day!