First of all this is my first post and im fairly new to working with Unix and creating scripts etc. so there will probably be wrong phrases used.
Lets get to my questions.
I have multiple scripts that submit Slurms/Jobs to the cluster starting like this and doing certain tasks:
...
I have to run multiple of those scripts AFTER all the Slurms from the preceeding job are finished. Now I want to write a script that does exactly that. I already tried something like this:
the problem seems to be that the skript thinks that testscript1.sh is done as soon as it submitted all the slurms in the array to the server and then it starts testscript2.sh. This leads to problems because testscript2.sh works with some files that are only created when the submitted slurms from testscript1.sh are done.
Thank you for your help
Last edited by Scrutinizer; 11-22-2018 at 09:53 AM..
Reason: code tags
sbatch exits immediately after the script is successfully transferred
to the SLURM controller and assigned a SLURM job ID. The batch script
is not necessarily granted resources immediately, it may sit in the
queue of pending jobs for some time before its required resources
become available.
So the two commands will be executed immediately after one another. The wait statement has no function here, since no shell controlled background jobs are specified/used in the shell script.
So you will need to create dependencies between jobs. Did you checkout the -d option?
Quote:
-d, --dependency=<dependency_list>
Defer the start of this job until the specified dependencies
have been satisfied completed. [..]
This User Gave Thanks to Scrutinizer For This Post:
I should start by saying that I am totally new to linux...
I am trying to create a script that downloads images from multiple cameras into a specific folder on my machine. Ideally renaming the images as they are downloaded.
I have installed gphoto2 which as a command line interface that... (0 Replies)
for UserName in `cat users` ; do useradd -d /u02 -s /usr/libexec/openssh/sftp-server -G ftp-users $UserName ;
PassWord=$( echo $( tr '' '' <<< ${UserName:0:1} )${UserName:1} ) ;
echo "$PassWord@123" | passwd $UserName --stdin ; done
can some one explain what the bold text do
Please use... (5 Replies)
I wonder whether someone can help me with what I'm trying to achieve
Basically, the objective is one script to create new user on more than 70 linux hosts if required.
Everything works apart from the highlighted part. It gave me an output
passwd: Unknown user name ''. when try to set... (35 Replies)
0
Hi,
I am looking for a way of creating multiple directories using the mkdir -p command in a shell script.
I'm working with an Ubuntu machine and try to do something like that:
#!/bin/sh
... (3 Replies)
Hi,
I need help in creating a array in shell scirpt.
I have a file which has following details.
hostname devices
device1
device 2
de
abcdmhs10 1234
2343
2353
3343
3435
2343
bcdfmhs11 2343
2443
3434
8874
0343
3434 (5 Replies)
Hello all...
I'd like to create a variable from an array element from two arrays. In my search for answers I found this code for bash that joins two arrays and then started to work with it. I had got to work once and then foolishly without saving the code, I started to edit it for ksh and... (4 Replies)
I need to create arrays like this:
cnt=0
{ while read myline; do
if ];then
firstpass="${myline##<meas>}"
meas="${firstpass%%</meas>}"
tempmeas="${meas%%;*}"
MEAS$cnt=$tempmeas
print $cnt
print ${MEAS'$cnt'}
... (2 Replies)
hi, I was wondering if there was a good way to create an array within a function, where the name is based on a passed argument? I tried this:
_____________________________
func(){
#take in 1st arg as the arrayname
arrayName=$1
let i=0
while read line
do
arrayName=${line}
let i+=1... (5 Replies)