Script: Clean up files and folder locations with logging and email

Obviously, this one is geared toward the network admins and system administrators out there.

I had a need to clean up some temp folders on a system every week or so because a poorly written application was filling up the drive with remnants of its daily operations...occasionally causing the process to stop.

Nothing like killing yourself slowly, eh?

Anyway, I had a script that was written by Tom Andre which cleared out a specified folder and emailed you the results of the process. This was great, but I wanted to expand on this a little bit and give it a way of accepting and cleaning a given list of paths.. Also, I wanted logging so I could tell if there was an error during processing.

So, I added those features and it is working nicely! Download the script here: http://snurl.com/24dbp [www_vbshf_com]

Download the file, rename with a .VBS extension. Edit the file and change the following variables:
  • AdminAddressSMTP - IP or hostname of your SMTP server
  • DomainName - The domain name for the sender address (the sender will be the server that the script ran on - i.e. server@yourdomain.com)
  • logfile - The location of the logfile you wish to write the results to.

0 comments:

Post a Comment

JS-Kit Comments