save a process in linux
I've been running my shellscript for about half an hour now. It's taking longer than I thought to process all the data. I have the process ID of it. Is it possible to save the process and log out then log in and continue the process? I know how to pause a process using kill -pause pID and continue it using kill -cont pID. But that only work if you don't log out after pausing it. Any kind of help would be appreciated.
|
I'm not sure about your current process, however in the future you can use a great utility called "screen". Using this program you can detach from a shell and come back to it later.
Regards, Fordeck |
Quote:
As fordeck said - use "screen" in the future. Cheers, Tink |
If the process has no connection with standard input, you can try the disown built-in. Using option -h it marks the job leaving it immune from hang-up signals (like those ones sent upon logout). In practice disown detaches the job from the parent shell and it will continue to run independently from what happens to the shell that can be terminated.
Please, note that disown may not work on stopped (paused) jobs: maybe it's safer to keep it running. You can give it a try, but I second the suggestion given by fordeck: the screen utility is very suitable for this kind of operations. Take in mind that you can resume a screen session even from another (remote) machine and you can still watch the standard output (not possible with disown, since in this case the connection between the standard output and the terminal is definitively lost). |
I would want to experiment with this first but I think that the bash builtin command called disown might work.
http://linux.die.net/man/1/bash Quote:
|
Thanks for the reply everyone. I'll be sure to use screen next time.
|
All times are GMT -5. The time now is 11:56 AM. |