I've tested this function out and it works well... it'll loop until
ntbackup.exe has exited and then the script goes on to rename the
backup.bkf file and copy it to a file server. Having _never_ done this
before I thought it'd be wise to run this by comp.lang.python. I know
it's a simple and stupid way in which to monitor a process, but it works
for me... is it safe to do this? I don't want to get too complex.
Thanks, Brad
def wait_for_ntbackup_to_exit(procname):
while True:
try:
pids = win32pdhutil.FindPerformanceAttributesByName(procn ame)
if len(pids) > 0:
print pids
print len(pids)
print "ntbackup is running... waiting for it to exit."
continue
except:
return