background programs
I need to do a LOT of compiling on a slow machine. The machine is accessale via ssh.
What I would like to do is: login to the machine via SSH start a compile ( that will in some cases take in excess of 24 hours ) be able to end the SSH session, and the process will still continue have the compile continue running, while not logged in at any time, ssh back in to check on things Basically, I want to ssh in, start something that will take an indefinate amount of time in the morning, check in on it at work (interact if necessary), come home at the end of the day, terminal in to start a new job, go to bed, wake up in the morning, and start the cycle again. What are some of the options that I have in doing this? It seems that if I issue "make foo &" and then logout, "make foo" gets killed. I need that ability to log out, and have "make foo" continue running. |
Maybe the screen program is what you need. It has many useful things, and the first one is the ability to run many text 'screens' in one terminal session. But is't ability to run in the background in "detached" state, and the possibility to "reattach" to the previously detached session (showing you all the output of programs which could be run there) can be what you need.
|
'screen' seems to be the command you need.
when starting screen, you get a 'virtual-terminal'. You can then detach this terminal, and log off off ssh. The programs you launched in 'screen' will keep on running. You can then later re-attach the screen-session, and continue. Here is a little link which might help a bit. You propably already have screen installed by default http://www.linuxforum.com/shell/screen/134-35.php edit: woops.. shy was a little faster than me:D |
Quote:
|
Quote:
|
screen
thank you for the suggestions. I'll RTFM for screen.
|
Any program can be run in background using &.
You can also use the sleep command. So you can start a script on that machine instead of remotely starting. E.g. create the file, runprogram.scr as #/bin/sh sleep <seconds> <your program compiling> and on a console chmod +x runprogram.scr (first time: change permission) runprogram.scr & How to incorporate screen - I don't know - others might know Sheng-Chieh |
All times are GMT -5. The time now is 02:28 PM. |