Using ColdFusion to check available disk space

This post is more than 2 years old.

I mentioned this in a presentation last week but I thought I'd bring it up with a concrete example. For those of you who allow file uploads to your server, how many of you actively check your free space on your server? Even if you don't use that feature, do you monitor free space anyway? Log files, in particular, can suck up quite a bit of space. Here is an incredibly simple ColdFusion template that checks for a minimum number of gigs of free hard drive space. If it is less than that threshold, or at 0, which didn't happen to me yesterday, honest, then it fires off an email.

Set this up to run hourly and you should be good to go. You could also make this check multiple drives if your server makes use of them.

So yeah -this so didn't bite me in the ass. Honest.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate for HERE Technologies. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA