Creating a task to Check for File

So I have a baseline with a bunch of SQL servers. The first component will run a script that will fail over the server in a SQL cluster. If for some reason the script failed or fail over failed it will create a file that will be placed in a folder on the root of C:. At that point I will use the following relevance statement to check for it and no longer want the machine relevant to that baseline and do not want it to continue so it is not patched.

exists file ("C:\scripts\auto_patch\vacate_server_failed.txt") whose (exists line whose (it contains "Failed") of it)

Or

I can do the opposite and if the file exist then move on and be patched but I do not want it to move to the next component until the file is in the location and if it never gets written then just sit in a waiting state until it is written of patch window completes. This will prevent a SQL server from getting patched before fail over.

I guess the question I have is how would I make a computer stop from being patched or relevant if file exist and not patch that specific server. The second option I was wondering if I add a pause statement in the relevance to not move on will it just sit there until the file exist or the maintenance window is over?

I think your first idea should work, except that if the failover succeeds the file would not be present; so I think your Baseline Relevance might be something like

not exists file ("C:\scripts\auto_patch\vacate_server_failed.txt") whose (exists lines whose (it contains "Failed") of it)

It might also be easier to do with a Client Setting. You also might have the failover task return a Fail code, by including something like this in the Action Script for it:

continue if {not exists file ("C:\scripts\auto_patch\vacate_server_failed.txt") whose (exists lines whose (it contains "Failed") of it)}

In the Take Action dialog for the Baseline, look for the option to “Continue if any component fails” and make sure that is un-selected.

If you use a “pause while” in a component and use a condition that never becomes true, the Action will pause indefinitely until the client is restarted or the computer is rebooted - but no other actions will run either, including actions unrelated to this patch baseline. I don’t think the end of the maintenance window would end the pause either, unless you specifically coded the “pause while” to check for a date/time.

Jason,

How would I go about doing this with a client setting? I was not aware you go add a setting to the client such as a relevance setting?

I’d advise to read through the Action Guide at http://www.ibm.com/support/knowledgecenter/SSQL82_9.5.0/com.ibm.bigfix.doc/Platform/Action/c_action_language.html (PDF version at ftp://public.dhe.ibm.com/software/tivoli/IEM/9.5/Platform/ ) , as well as this Forum and the community site https://bigfix.me . The Guide very short but can give you a foundation for what’s possible in the ActionScript language.

To apply a custom client setting, you’d use a statement like

setting "custom_SQLServer_Patch_Available"="false" on "{now}" for client