Help with finding the exit status of a 'nohup' command using 'PID'.
Hello All,
I need to run a set of scripts, say 50 of them, parallely. I'm running these 50 scripts, from inside a script with the help of 'nohup' command.
1.The fifty scripts are stored in a separate file.
2.In a master script, i'm reading every line of the file through loop and executing them.
3.The master script should succeed, if and only if, all the 50 scripts that has been called succeeds. Or else should fail.(Exit 0)
So far, this is what i have tried :
But this runs the scripts sequentially and NOT parallely. I need to start all the scripts parallely using nohup(or any other means if possible) and should be able to track their exit status individually.
Well wait will for sure make your loop work in sequence since it will wait the end of execution of $PID...
With the logic you put in your script you wont be able to do anything else but sequential for you are to wait for end of execution to get the return code and if more processes are executed you have no means using $? to get what you want...
Last edited by vbe; 09-18-2014 at 11:40 AM..
Reason: typo...
I would do:
otherwise you can make a wait between the 2 loop
and execute all your script with the time command:
time binary time can output the exit code.
Good Morning
I need your help please, i tried to execute this script using nohup command but it gets in status stopped
nohup ./SapInterfases.sh > SapInterfases.log &
prodstg02$ jobs
+ Stopped(SIGTTOU) nohup ./SapInterfases.sh > SapInterfases.log &
I check out log:
$ more... (15 Replies)
Hi All,
I am doing an export and import (datapump) of 4 schema. I know we can do an export of 4 schema in one command. But just want to know how to check the exit status if i do the export/import of 4 schema in different commands in background. Please suggest.
Thanks,
Mani (1 Reply)
Hi to all, I hope that you can help me with this...
SCO Unix 5.0.5, old mashine Pentium III x86, SCSI HDD 36.4 Gb
PANIC: exit – Cannot exec /etc/init (PID 1), status 0x00000200
Cannot dump 49055 pages to dumpdev hd (1/41) : space for only 48640 pages
Dump not completed
Safe to Power Off... (1 Reply)
Hello All,
I am trying to capture the exit status of find command and want to delete the files only when it is successful. But it is always returning me as success even if the pattern of that file doesn't exist in the current directory. please help, checked manual page but couldn't able to figure... (6 Replies)
Hi,
I have run a shell script as a background process using 'nohup' command. I want to see the process id of this, so that I will be able to kill it later on when required.
I tried to collect these details using 'ps' command and could not view this information.
How do we get this... (5 Replies)
Hi,
Want to log the output of command & check the exit status to find whether it succeeded or failed.
> ls abc
ls: abc: No such file or directory
> echo $?
1
> ls abc 2>&1 | tee log
ls: abc: No such file or directory
> echo $?
0
Tee commands changes my exit status to be always... (7 Replies)
hi all
when ever i power on my sco server it give me the message:PANIC: exit - cannot exec /etc/init (PID 1), status 0*00000200. its not booting. any help?? (1 Reply)
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (10 Replies)
Hi to everyone.
How can I get the exit status from a remote command executed with rexec? :eek:
machine A has RedHat Linux 9 and the remote machine B has SCO UNIX.
Code:
rexec -l user -p password host sh /u/files/scripts/seq_cal.sh 2006 08
I want the exit status returned by... (1 Reply)
I am executing a find command in my script i.e
find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \;
how do i check that this command is executed properly.. i would lke t trap the errror and display my error message
kinly help.. this is an urgent issue. (1 Reply)