LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-03-2004, 02:36 AM   #1
comp_brad1136
Member
 
Registered: Nov 2004
Location: SW Missouri, USA
Distribution: Debian 6 "Squeeze"
Posts: 55

Rep: Reputation: 7
Question 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.
 
Old 11-03-2004, 02:44 AM   #2
shy
Member
 
Registered: Dec 2002
Location: Russia
Distribution: ASP linux
Posts: 94

Rep: Reputation: 15
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.
 
Old 11-03-2004, 02:45 AM   #3
EyesOnly
Member
 
Registered: Aug 2003
Location: The Netherlands
Distribution: SlackWare
Posts: 202

Rep: Reputation: 30
'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

Last edited by EyesOnly; 11-03-2004 at 02:46 AM.
 
Old 11-03-2004, 02:56 AM   #4
shy
Member
 
Registered: Dec 2002
Location: Russia
Distribution: ASP linux
Posts: 94

Rep: Reputation: 15
Quote:
Originally posted by EyesOnly
woops.. shy was a little faster than me
Sorry, I hope you don't mind
 
Old 11-03-2004, 05:36 AM   #5
EyesOnly
Member
 
Registered: Aug 2003
Location: The Netherlands
Distribution: SlackWare
Posts: 202

Rep: Reputation: 30
Quote:
Originally posted by shy
Sorry, I hope you don't mind
'course not
 
Old 11-03-2004, 11:51 AM   #6
comp_brad1136
Member
 
Registered: Nov 2004
Location: SW Missouri, USA
Distribution: Debian 6 "Squeeze"
Posts: 55

Original Poster
Rep: Reputation: 7
Smile screen

thank you for the suggestions. I'll RTFM for screen.
 
Old 11-03-2004, 05:45 PM   #7
shengchieh
Member
 
Registered: Jul 2004
Location: Palo Alto, CA
Distribution: #! Korora
Posts: 472

Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running programs in background via & parameter dissectional Linux - General 6 11-03-2005 07:09 PM
trying to remove kwebdesktop from background programs menu scottie4442 Linux - General 1 04-05-2005 10:02 AM
Run programs in background... Cybers19 Linux - Newbie 1 06-02-2004 03:54 AM
Programs running in background on linux?? JellyStones Linux - General 4 02-10-2004 05:42 AM
running programs in background koiphish Linux - Software 0 07-07-2003 01:48 AM


All times are GMT -5. The time now is 10:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration