interesting idea with wmi...

  • you know how you can compare 'drive space vs backup size' with xp_fixeddrives...

    is there a way (or has it already been done) that you can use

    wmi to compare drive space, and dbase size prior to backup??

    this way in the event there isn't enough space to support the .bak

    file i can just customize a particular error message indicating

    just that, and possibly the difference in size.

    thoughts?

    _________________________

  • I use WMI scripts for everything except for the disk drive space which I would like to implement next, just need an extra hour.

    You most certainly can create a step 1 of your backup job which is ActiveX script or Operating System Command type with the command "cscript myscript.vbs"

    The question is how your return the value to the next step? When I work from the VBscript I put a value in a file. When I work from the database I would put a value into the database table using ADO from the script.

    Another idea is to just run a VBScript on schedule using Windows Task Scheduler. First procedure may use WMI to get the free space. Second procedure may call OSQL to make backups, third procedure may alert the operator using SMTP email if there is not enough drive space.

    Here is how you run the osql batch from the VB script assuming your OSQL batch is already coded and its name MyBatch.bat

    Sub ExecuteMyBatch

    Dim sh

    Dim ReturnCode

    Dim strCommand

    Dim strStyle

    Dim StrWait

    strCommand = "MyBatch.bat"

    strStyle = 1

    StrWait = False

    Set sh = CreateObject("WScript.Shell")

    ReturnCode = sh.Run(strCommand, strStyle, strWait)

    ' sh.Popup("Return code is " + rcode)

    End Sub

     

    Regards,Yelena Varsha

  • i'm thinking more exclusive wmi if possible.

    any takers?

    _________________________

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

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