, ,

Script to monitor server total file amount and send e-mails

If you are using an usual hosting or VPS you probably have limit of about 1 mln or eg. 0,5 mln of files (iNODEs). It’s crucial to monitor amount of files especially if you have a lot of aplications generating cache or session files. Hosting providers not always has such monitoring systems, so when you reach the limit hosting will be automaticly blocked and in most cases you cant even login to your admin panel if it’s on the same virtual account.

I wrote short script to count files on your server, check if its exceeds limit and eventualy sends e-mail with warning.

Put it as eg. count_files.sh as low directory as possible eg. “/” for VPS or in /home/username/ directory for standard hosting.