checking directory size

  • Is it possible to use xp_cmdshell and check a directory size, if it is less than 2GB to send a notification to an operator in SQL server? I am having a backup drive with no raid on it. Please show me a way, so that, it there is an alert, we can go and remove some old logs. thanks in advance.

  • Well, some thoughts on this.

    What you can do, is write a small app in some language that checks your directory size and returns either 0 or 1. This return value you can catch and evaluate.

    I think this can possibly be done with Windows Scripting Host and the FileSystemObject. I remember the Folder Object has a property Size.

    Are my thoughts going in your direction?

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply