Forum Discussion

kirk_bottomley's avatar
kirk_bottomley
Contributor
12 years ago

Is there a way to not show a failure if a process doesn't exist?

I've got a script that cleans up my folder for the next run. It can't copy files if the process is running, so I have a simple If process.exists, then process.terminate. Then it goes on to delete some files and replaces them with clean ones.

It's ok with me if the process exists or doesn't, but when I check my log, the entry shows as a failure if it couldn't shut down the process because it wasn't there.

Is there any way for the log to not register a process.exists == False as a big red X and be agnostic to the existence check?