order - Force shell script to run tasks in sequence -


i'm running shell scripts executes several tasks. thing script not wait task end before starting next one. script should work differently, waiting 1 task completed before next 1 start. there way that? script looks this

sbatch retr.sc 19860101 19860630 scp en/en1986* myhostname@myhost.it:/storage/myhostname/metfiles 

the first command runs retr.sc, retrieves files , takes half hour roughly. second command, though, run right soon, moving files destination. wish scp command run when first complete.

thanks in advance

you have several options:

  • use srun rather sbatch: srun retr.sc 19860101 19860630
  • use sbatch second command well, , make depend on first 1

like this:

res=$(sbatch retr.sc 19860101 19860630)    sbatch --depend=after:${res##* } --wrap "scp en/en1986* myhostname@myhost.it:/storage/myhostname/metfiles" 
  • create 1 script incorporates both retr.sc , scp , submit script.

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -