Nohup and background jobs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Nohup and background jobs
# 1  
Old 09-11-2012
Nohup and background jobs

Hi All,

Can someone help me in knowing the exact difference between nohup and &.

The definition is quite clear but i only want to know if i run my job using & and in between i hung up my terminal.
# 2  
Old 09-11-2012
The definition doesn't seem to be clear. Why don't you try it out?
# 3  
Old 09-11-2012
Reply

Hi,

Actually i tried with &. my job is getting killed at terminal logout
# 4  
Old 09-11-2012
Try
Code:
nohup <yourscript/command> &

# 5  
Old 09-11-2012
bash has the disown builtin that makes a background job immune to its parent logging out.
# 6  
Old 09-11-2012
Quote:
Originally Posted by RudiC
bash has the disown builtin that makes a background job immune to its parent logging out.
As Rudic said...

Using nohup and & script can work even if our session stopped/expired. Even if we restart the server script will continue to run automatically.
Code:
nohup sh script_name &

# 7  
Old 09-11-2012
Reply

My Query is still not answered.

If i only use & and my terminal gets hunged. will by job will continue or will be killed.

Ex : sh my_script.sh &

Last edited by Uinx_addic; 09-11-2012 at 07:19 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I send output of a background process to a file other than nohup.out?

I have a question. I will be running a background process using nohup and & command at end. I want to send output to a file say myprocess.out. So will this command work? nohup myprocess.ksh > myprocess.out & Thanks in advance guys !!! :) (3 Replies)
Discussion started by: vx04
3 Replies

2. Shell Programming and Scripting

How to stop nohup which is working background

Please I have run a background script using nohup please tell me way to stop this. Thanks in Advance (4 Replies)
Discussion started by: mumakhij
4 Replies

3. Programming

Background (nohup * &) SSH command block possible?

Hello, I am trying to find a way to send several sequential commands via SSH to a remote box in a single command. Thoughts so far: 1) Can I put them into a function and call the function within the ssh command? e.g. ssh <targetserver> $(functionx) No - then it calls the function in... (4 Replies)
Discussion started by: doonan_79
4 Replies

4. Solaris

solaris terminal sessions terminated and also nohup jobs

Admins, We have a strange problem on our solaris zones. We have four zones on a Global server (Sun-Fire-V890; Solaris 10 Update 6) and the SSH sessions to all four zones are terminated at a specific time (11:10 PM) every night. The SSH session to the global server is not terminated. Also, any... (1 Reply)
Discussion started by: yogijp
1 Replies

5. UNIX for Advanced & Expert Users

nohup and background process

What is the difference between running a process using nohup and running a process in background ? Please explain (6 Replies)
Discussion started by: srksn
6 Replies

6. UNIX for Dummies Questions & Answers

Background jobs

If I run a job in the background and logoff. Will the job continue to run or will my processes be killed ? (1 Reply)
Discussion started by: jxh461
1 Replies

7. UNIX for Advanced & Expert Users

Notification from Background jobs

Reposting, as it got lost during the database backup. :( Via a shell script a spawn 3 background jobs namely a, b & c. These will take different times to complete. I want to print a different message on completion of each. How can i find out when each one has completed independently. ... (19 Replies)
Discussion started by: vibhor_agarwali
19 Replies

8. Shell Programming and Scripting

background jobs exit status and limit the number of jobs to run

i need to execute 5 jobs at a time in background and need to get the exit status of all the jobs i wrote small script below , i'm not sure this is right way to do it.any ideas please help. $cat run_job.ksh #!/usr/bin/ksh #################################### typeset -u SCHEMA_NAME=$1 ... (1 Reply)
Discussion started by: GrepMe
1 Replies

9. Programming

Background jobs

Hi there, I'm quite new to UNIX for programming. I have a script that does this: Shows on screen real-time results taken from phone calls and logs them in a file. However, when I start my script, I want my script to start logging in the file in the background, so I can continue working on... (1 Reply)
Discussion started by: Jeremiorama
1 Replies

10. Shell Programming and Scripting

background jobs

Hi, i have a problem with turning a job into backgrund. When i enter this at the shell: spice -b darlington.cir -r output.raw > screenout.tmp & and then let me show the currently running jobs, i get the following output: + Suspended (tty output) spice -b darlington.cir -r output.raw >... (4 Replies)
Discussion started by: qsi
4 Replies
Login or Register to Ask a Question