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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -