LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   [Quick questions] (https://www.linuxquestions.org/questions/linux-newbie-8/%5Bquick-questions%5D-875454/)

Fracker 04-17-2011 10:33 AM

[Quick questions]
 
What happens when my session disconnect because of network problem while execution of bash script

Say my shell script takes like 5 hrs, with 5 statement one statement taking 1 hr each after 30 mins, my session disconnect, what will happen?

1) my 1st statement completes then no other statement get executed?
2) my all statements executes and then finish?
3) my 1st statement will also not be completed

I can see my 1st statement through processes, problem with 'ps' it don't show bash script name, even if it is in memorry

Also, what i need to put in my script so next time even after even disconnect my scripts remaining executing (other then nohup)

acid_kewpie 04-17-2011 12:10 PM

Please use useful and informative thread titles in future. The title should reflect the content, not be some sort of "meta title" saying that it's a question.

When a bash session terminates, the child processes will all terminate at the same time (save for certain issues like locking mechanisms which will cause some forms of delay if they are not able to respond the the terminate signals.)

Your questions are looking a fair bit like homework, I really hope that they are not. Why have you given us multiple choice?? Why are you excluding nohup in the last query? Those things like homework to me...

Fracker 04-17-2011 03:00 PM

Yeah i realize that after posting the question, i try to edit it but u can't change the title.

Any ways, thanks for the answer. After looking for a while i found the process was completely loss, and even 1st statement didn't finished properly.

now i will update my script completely so my process don't fail again.

*****
Closing this Thread
*****

MTK358 04-17-2011 03:11 PM

Mark the thread as solved.


All times are GMT -5. The time now is 11:11 AM.