Pause while

(imported topic written by cstoneba)

my file exists, however my action still waits 3 seconds. I want the pause to only last until one of the conditions becomes true (either the time limit is reached or the file exists)

parameter “startTime”="{now}"

pause while { (now-time(parameter “startTime”) < 3*second) or (not exists file whose ((name of it = “SQLServiceAccountChangeScriptOutput_” & (computer name) & “.txt”) AND exists lines whose (it contains “BigFix:DONE”) of it) of folder “c:\logs”) }

(imported comment written by cstoneba)

can anyone assist me?

(imported comment written by MattBoyd)

FYI: http://forum.bigfix.com/viewtopic.php?id=4391

What about something like this:

if {(not exists file whose ((name of it = “SQLServiceAccountChangeScriptOutput_” & (computer name) & “.txt”) AND exists lines whose (it contains “BigFix:DONE”) of it) of folder “c:\logs”)}

parameter “startTime”="{now}"

pause while { (now-time(parameter “startTime”) < 3*second) or (not exists file whose ((name of it = “SQLServiceAccountChangeScriptOutput_” & (computer name) & “.txt”) AND exists lines whose (it contains “BigFix:DONE”) of it) of folder “c:\logs”) }

endif

(imported comment written by cstoneba)

I used a 3second timeframe for this example, but my real fixlet uses 30minutes. In your example, if the file doesn’t exist, it will wait 30 minutes. If the file is created after the 30 minute timer starts, the client will still wait 30 minutes.

This is closer, but I want the pause to stop once the file exists, or the times hits the goal.

(imported comment written by MattBoyd)

It just occurred to me that you have an OR that should probably be an AND…

parameter "startTime"="{now}"
pause while { (now-time(parameter "startTime") < 3*second) AND (not exists file whose ((name of it = "SQLServiceAccountChangeScriptOutput_" & (computer name) & ".txt") AND exists lines whose (it contains "**BigFix:DONE**") of it) of folder "c:\logs") }

true OR false = true

true AND false = false

(imported comment written by cstoneba)

if it’s AND, won’t both constraints need to be true (ie the time must be 3 and the file must exist)?

(imported comment written by MattBoyd)

cstoneba

if it’s AND, won’t both constraints need to be true (ie the time must be 3 and the file must exist)?

You might be thinking about it in reverse. Pause While will continue to pause while the relevance evaluates to true. Once the statement evaluates to false, the process continues.

Consider the situation where the time elapsed is less than 3 seconds, but the file now exists:

Pause While
the time is less than 3 seconds (evaluates to true)
OR
the file does not exist (evaluates to false)

This evaluates to

Pause While true OR false

, which means that the process will pause until both values evaluate to false.

Pause While true AND false

will pause until one of the values evaluates to false (true AND false = false).

I hope I’m not confusing you.

(imported comment written by cstoneba)

clear as mud :slight_smile: I’ll give ‘AND’ a try. thanks boyd