Bash script for calling Java programs -
Bash script for calling Java programs -
i have jar file can phone call next way: java -jar myjar.jar param1 param2 param3
now need bash script waits until clock time reached (e.g. 5pm) , calls jar file several times, lets 5 times (so have 5 jvms running). moreover, arguments passed bash script should passed jar. then, after times (e.g. 10 minutes), started java programs should killed.
how can this?
thank much.
a bash script waits until clock time reached (e.g. 5pm) , calls jar file several times, lets 5 times
update: many glenn jackman, incorporated reply
#!/bin/bash cat<<endblock | @ 5pm in {1..5}; java -jar myjar.jar "$@" & pid=$! { sleep 600 && kill $pid; } & done endblock
java bash automation
Comments
Post a Comment