commands to be executed in order for a batch jobs!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting commands to be executed in order for a batch jobs!
# 1  
Old 01-18-2009
commands to be executed in order for a batch jobs!

Hi All,

I am trying to run this script. I have a small problem:
each "./goada.sh" command when done produces three files (file1, file2, file3) then they are moved to their respective directory as can be seem from this script snippet here.

The script goada.sh sends some commands for some calculations as jobs to a certain system. These jobs run in parallel with each others and produce their outputs to the same directory.

The produced files from each run of "goada.sh" will have the same name and they will be overwritten by each other.

The only thing I could come up with is to look for a command that will make sure that each line of the script will be executed, if and only if the previous command is executed. Is this possible?

Code:
#!/bin/sh

./clean.sh

mkdir adabdt/bdt01
mv *.root adabdt/bdt01/
mv *.spr adabdt/bdt01/
mv *.log adabdt/bdt01/

mkdir adabdt/bdt02/
sed -i -e "s/-l 50/-l 100/" adaBDT01.sh
sed -i -e "s/-l 50/-l 100/" adaBDT02.sh
sed -i -e "s/-l 50/-l 100/" adaBDT03.sh
nohup ./goada.sh > anything


./clean.sh
mv *.root adabdt/bdt02/
mv *.spr adabdt/bdt02/
mv *.log adabdt/bdt02/

mkdir adabdt/bdt03/
sed -i -e "s/-l 500/-l 1000/" adaBDT01.sh
sed -i -e "s/-l 500/-l 1000/" adaBDT02.sh
sed -i -e "s/-l 500/-l 1000/" adaBDT03.sh
nohup ./goada.sh > anything

# 2  
Old 01-22-2009
Why not cd into the destination before running the script, so that it creates the output files in there, and use nohup ../../goada.sh?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Run Jobs in Order

Hi All, This might be a silly question and sorry but I didn't know where to start with this. I have a process I need to run 31 times and they must be one after another e.g. Only run after the other has run. It will call a script that I have that runs 3 other processes in order (and... (3 Replies)
Discussion started by: xathras1982
3 Replies

2. Shell Programming and Scripting

Processing different jobs as a batch process

Hi All, I want to process consecutive jobs in a sequence but when I execute 1 job ,the control does not return to the command prompt to continue with the next job. Can anyone help me here? Thanks (3 Replies)
Discussion started by: Taranjeet Singh
3 Replies

3. UNIX for Dummies Questions & Answers

Unix Batch command, and running jobs in queues.

Hello all, I have a quick question. I work in a computational science laboratory, and we recently got a few mac pros to do molecular optimizations on. However, on our normal supercomputers, there are queue systems, mainly PBS. Anyway, the macs obviously don't have PBS, but I've read about... (0 Replies)
Discussion started by: corrado33
0 Replies

4. Shell Programming and Scripting

To inform the executed commands

Dear friends, Whenever I do logout from a session initiated by ssh/su, I need to print a small report which says the login time, logout time, commands got executed.. How can it be done? I know when doing ssh, .profile file will get executed. Shall we do something with the help of it. (1 Reply)
Discussion started by: nagalenoj
1 Replies

5. Shell Programming and Scripting

Viewing the commands executed

Hi, I have executed a set of commands on the linux server and later rebooted the server. Is it possible to get the details of the commands I executed prior to the reboot? If yes please let me know how? Thanks. (1 Reply)
Discussion started by: yoursdavinder
1 Replies

6. UNIX for Dummies Questions & Answers

Removal of at and batch jobs

I have created at and batch jobs. but it need to modified. Also as these jobs can not be modified it has to removed and reschedule. can anyone help me how to remove these jobs. using cron this can be done easily. but i need to do it using at and batch jobs. (1 Reply)
Discussion started by: palash2k
1 Replies

7. UNIX for Dummies Questions & Answers

How does the internal commands are executed?

Hi all, I am new to unix OS. Commands(external commands) given by the user are examined by shell and later executed by kernel. Now I want to know how the internal(built in) commands are executed. Please clarify whether they are executed directly by shell or by kernel. Thanks in... (2 Replies)
Discussion started by: chaitra
2 Replies

8. Shell Programming and Scripting

How to write a Script to run series of batch jobs on unix platform

Im new to unix shell scripting, I have to run batch jobs on unix. for example i have 5 jobs. first 2 can kickoff parallely. after completely finishing the 2 previous jobs the 3 job should kick off..once 3rd is over 4 th and 5th can kick off parallely. Each jobs run for 1 or 2 hours each. How to... (2 Replies)
Discussion started by: venki311
2 Replies

9. UNIX for Dummies Questions & Answers

Deleting a batch of print jobs

Hi Guys I have over 2000+ print jobs in one queue which I would like to delete. Is there away in AIX 4.3 that I can delete the whole print jobs at ocne. Instead of one at a time. Thanks (1 Reply)
Discussion started by: orvelb
1 Replies
Login or Register to Ask a Question