LinuxQuestions.org
Review your favorite Linux distribution.
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 06-22-2006, 04:21 PM   #1
shozmo
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Rep: Reputation: 0
SSH forked process


I need to login to my linux box at a remote location, create a job running

e.g. on my gentoo box i may wish to set off:

> emerge --update --deep world

I then need to close the terminal and leave it to finish doing it's stuff without me logged in.

Is this possible?

Rgds,

Shozmo.
 
Old 06-22-2006, 04:40 PM   #2
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
I would suggest you create a cron job to do it.

If you go here: http://www.mkaz.com/ref/unix_cron.html
there is a pretty good explanation of how to use it. You can delete the job the next day if you want.

I would say if you opened an SSH session and used the '&' after the command which makes the command run in the background, it will end once you end your ssh session.
 
Old 06-22-2006, 04:50 PM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,791
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Check out using the screen command. Essentially you use screen to create a virtual terminal that stays running. You can get out of the running screen, close ssh and the screen will be unaffected. Next time you log in, you re-attach the screen and you're good to go. Sort of like VNC for command line.
 
Old 06-22-2006, 04:57 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Another option is to use the nohup command.
 
Old 06-23-2006, 03:24 AM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Yep, the traditional (& prob simplest) method is:
nohup <yourprog_and_params> &
 
Old 06-23-2006, 03:49 AM   #6
shozmo
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Great! loads to go at hear, thanks for the advice guys, much appreciated.

Shozmo.
 
  


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
open a process from ssh rino.caldelli Linux - Security 3 03-14-2006 11:22 PM
ssh-agent process buildup nifflerX Linux - General 4 03-09-2006 10:23 AM
Conectiva 10 Forked thorn168 Conectiva 0 09-07-2005 11:58 AM
ssh-agent process not killed Notwerk Fedora 0 06-20-2005 08:07 AM
how to connect forked process to a specific terminal pcweirdo Linux - Software 2 02-22-2005 04:17 AM


All times are GMT -5. The time now is 06:32 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration