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 07-03-2009, 02:54 AM   #1
kiranghag
LQ Newbie
 
Registered: Jul 2009
Location: http://www.kiranghag.com
Distribution: Centos 5
Posts: 1

Rep: Reputation: 0
Question persistent shell for headless box - need to run commands and disconnect


I am running a headless Centos 5 box.

I need shell access to this server over LAN with the ability to run the command and disconnect without waiting for the command to finish. And then check back minutes/hours later.

I am using ssh but whenever I logout, the commands are lost. remote X using XDMCP is very slow and sometimes there is no workable desktop after login greater. Though I dont want to concentrate getting that sorted out unless its the only good way of achieving my objective.

I resort to scheduling the command using cron but I believe there could be other way to have a persistent console

Any pointers?
 
Old 07-03-2009, 03:12 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Try screen. See here for some detail. Basically you can launch a screen session on the remote machine, run your command, then detach the screen session from the terminal. Later you can re-open the screen session and see the progress of your command.
 
Old 07-03-2009, 05:24 AM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
If the command isn't interactive, run it as 'nohup command &', and it'll keep running after you disconnect.

Dave
 
  


Reply

Tags
headless, persistent, shell


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
Shell Script - Change user & run multiple commands ijf99 Linux - Newbie 1 01-26-2009 06:15 AM
Recording all commands run on remote shell. AbecX Linux - Server 1 05-18-2007 08:42 AM
how can i run a shell scripts (or a number of commands )when a user logs in to a linu rddreamz Programming 4 05-20-2004 03:08 PM
PHP to run Shell commands Gear_freak2000 Linux - Software 4 06-04-2003 05:39 AM
shell problems ? cant run Java commands RedHat123 Linux - General 2 07-16-2002 10:29 PM


All times are GMT -5. The time now is 09:20 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