Waiting for a folder in a Batch script
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I have a batch script that launches a tomcat server. The script starts the service, which unpacks the files and folders in the "webapps" directory. I want to copy image files (that are added by the customer) into the webapps directory so they can be used by the server. However i need to wait until the folder has been unpacked so that the directory exists before i can add the images to it, what command or commands could i used to make this happen (apart from just waiting an arbitrary long enough time) , I am no expert at this stuff but this works for me @echo OFF
:START
if not exist c:\abc GOTO WAIT
GOTO COPY
:WAIT
:: pause for 1 second
ping 127.0.0.1 > nul
GOTO START
:COPY
ECHO "DO COPYING STUFF"
|
How to handle batch script waiting for input from another batch script
Date : March 29 2020, 07:55 AM
it helps some times Use choice.exe with a default timeout in the inner batch file. Choice is in many versions of Windows (early and recent) but not all. XP doesn't have it for example, but free choice clones exist too.
|
Parallelise a Shell script without waiting for a batch to finish
Tag : shell , By : unadopted
Date : March 29 2020, 07:55 AM
will be helpful for those in need The desired queue behavior, (but not necessarily the CPU assigning), can be made to work with command grouping like so: { ./hello<params1.txt && ./hello<params3.txt ; } &
{ ./hello<params2.txt && ./hello<params4.txt ; }
{ { echo a && sleep 2 && echo b ; } &
{ echo c && sleep 1 && echo d ; } } | tr '\n' ' ' ; echo
a c d b
|
Waiting until the task finishes
Tag : swift , By : Stephen Judge
Date : March 29 2020, 07:55 AM
I wish this help you Use DispatchGroups to achieve this. You can either get notified when the group's enter() and leave() calls are balanced: func myFunction() {
var a: Int?
let group = DispatchGroup()
group.enter()
DispatchQueue.main.async {
a = 1
group.leave()
}
// does not wait. But the code in notify() gets run
// after enter() and leave() calls are balanced
group.notify(queue: .main) {
print(a)
}
}
func myFunction() {
var a: Int?
let group = DispatchGroup()
group.enter()
// avoid deadlocks by not using .main queue here
DispatchQueue.global(attributes: .qosDefault).async {
a = 1
group.leave()
}
// wait ...
group.wait()
print(a) // you could also `return a` here
}
|
Wait batch script till CURL finishes execution
Date : March 29 2020, 07:55 AM
Any of those help You have percentage signs in the URL. You need to double them in a batch-file i.e. % replaced with %%.
|