bash - Build scripts with command delay -
im using in command line 3 commands , since i'm doing on , on again want build script, problem following :
this im doing
1 . cd users/home/d56789/tmp
- > tar czf ../fts/runnerer.tar app/
this take 2 sec
2 . cd users/home/d56789/fts
- > cf update-run mybp -p /home/d56789/fts/ -i 4
this take 8 sec
- cd
users/home/d56789/myapp
-> cf push
this take 30 sec
my question how can build script can commands 1 after other needed delay between them ?
commands executed in sequence. example tar
command in question, while it's running, cannot start running else. have wait complete.
as such, can list commands want in script, , executed 1 after another. doesn't matter if 1 commands takes 2 seconds or 22, next command not run until previous completed.
set -e cd users/home/d56789/tmp tar czf ../fts/runnerer.tar app/ cd ../fts cf update-run mybp -p /home/d56789/fts/ -i 4 cd ../myapp cf push
i added set -e
@ top safety. is, if of commands fail, script exit without executing rest.
if need delay reason (i don't see such reason in question), can use sleep
command. takes number of seconds parameter, sleep 10 seconds run sleep 10
, sleep 5 minutes run sleep 300
.
Comments
Post a Comment