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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -