How to find that 'runas' execution finished?
Posted
by
Radek
on Stack Overflow
See other posts from Stack Overflow
or by Radek
Published on 2012-10-15T03:17:39Z
Indexed on
2012/10/15
3:36 UTC
Read the original article
Hit count: 171
I use ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
on Windows7
To do mySQL backup I run runas /savecred /user:yogurt\administrator "cmd.exe /k mysqldump --user=#{dbuser} --password=#{dbpassword} #{dbname} > #{dump}"
- mysqldump must be executed as administrator. I do not run my ruby scripts under administrator account.
runas starts new cmd.exe and ruby doesn't wait for it to finish. Dump process takes about one minute to finish. After that I zip the dump file and delete it.
But I have to make sure that the dump process already finished before I do any other action on that file. Right now I use sleep(60)
that works but I wonder if there any better more systematic solution.
© Stack Overflow or respective owner