Kaseya Community

Search for a certain file

  • We have an SQL server that *should* create a backup called SQL.BAK every night 11pm.

    We would like to write a script that will check for the existence at about 11:30pm for the file called:

    (D:\MSSQL\Backups\Staging) that has today’s date on it.

    Preferably, it should be able to detect if the .Bak was made after 11pm, just in case there was a manual backup during the day and the 11pm backup is the one that failed.

    If the file is NOT present, we would like it to alert us via e-mail

    Any help point me in the right direction would be great also.
    Thanks

    Legacy Forum Name: Search for a certain file,
    Legacy Posted By Username: gxanetworks
  • Something like this

    Script Name: test
    Script Description: Send email if file does not exist

    IF Test File
    Parameter 1 : D:\MSSQL\Backups\Staging\SQL.BAK
    Absent :
    THEN
    Send Email
    Parameter 1 : your@email.tld
    Parameter 2 : your subject
    Parameter 3 : what you want it to say
    OS Type : 0
    ELSE


    As for the alert, theres a thread in here about creating an event log entry that can trigger the alert.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty