1752801 Members
5204 Online
108789 Solutions
New Discussion юеВ

nohup question

 
Ignite_2
Frequent Advisor

nohup question

Hello,

could you please help me...

Is it possible to apply 'nohup' on process running in foreground, to let it continue after logout?

Thanks in advance
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: nohup question

Typically you use nohup to put it in the background:
nohup command &
Ignite_2
Frequent Advisor

Re: nohup question

Hi

yes, normally it's like that.

I have started copying data and didn't expected it can take so long.

Is there any possibility, how to apply on running process from another session 'nohup'?
Dennis Handly
Acclaimed Contributor

Re: nohup question

>how to apply on running process from another session 'nohup'?

I don't know of any.
Johnson Punniyalingam
Honored Contributor

Re: nohup question

Hi,

You can put "all the required files to copied " in script. than you can let it continue after logout?

Example:-

# vi copy.sh
cp -p /opt/oracle/dbf* /opt/oracle/source

# nohup ./copy.sh &

Hope this helps,

Thanks,
JOhnson
Problems are common to all, but attitude makes the difference
Ski Ride
Advisor

Re: nohup question

Hi Ignite

I believe you cannot use nohub on a process that is already running.

I believe this is wat is ur question.
sujit kumar singh
Honored Contributor

Re: nohup question

Hi


This is alwayu suggested to start a process with a nohup as in your case so that the process keeps up running in case the executing terminal is logged out or killed.
regards
sujit
hbhua_231
Advisor

Re: nohup question

I found that if you invoked another shell, then ran the nohup script, then exited your child shell, the nohup would continue to run properly.

sh
nohup sar -u 5 5 &
exit

------------------------
good luck.
Heironimus
Honored Contributor

Re: nohup question

If your shell is modern enough you can ctrl-Z to suspend the foreground process, "bg" to resume it in the background, and "disown %jobnum" to tell the shell to forget about it and not send a SIGHUP on exit. A little more to type, but it produces the same end result as running via nohup.