LinuxQuestions.org
Visit Jeremy's Blog.
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-30-2009, 02:42 PM   #16
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0

Code:
joomlascape:~/joomla# nohup sh.sh &
[1] 23739
joomlascape:~/joomla# nohup: ignoring input and appending output to `nohup.out'
nohup: cannot run command `sh.sh': No such file or directory
thats what i get now
 
Old 11-30-2009, 06:11 PM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
You need to tell it where the prog is and redirect the outputs ie

Code:
nohup /path/to/sh.sh >sh.log 2>&1 &
 
Old 11-30-2009, 09:40 PM   #18
grant-skywalker
Member
 
Registered: Jul 2005
Location: Jakarta / Kuala Lumpur
Distribution: Slackware, Debian, Ubuntu, Centos
Posts: 40

Rep: Reputation: 15
Hi,

Using nohup is a good choice, another alternative you may want to try is 'screen'.

It lets your session(s) in the server remain uninterrupted while you may close your Putty and reopen it anytime you like.

Check that out!
 
Old 12-01-2009, 12:19 AM   #19
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
ok nohup command doesnt give eny error but it doesnd run the server either get this
Code:
[1] 24451
and the screen commands starts something but it says that it cant find sh.sh file
Code:
Cannot exec 'sh.sh': No such file or directory
EDIT: NVM forgot to type in sh before sh.sh and the screen works now thanks alot you guys

Last edited by Fierce; 12-01-2009 at 12:23 AM.
 
Old 12-01-2009, 12:30 AM   #20
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
ok but now i have another problem how to close that program after its been opened? since i need to keep updating the server from time to time and that requires program beeing restarted.
P.S. Sorry guys for the trouble
 
Old 12-01-2009, 12:40 AM   #21
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
If using the nohup method, use the ps command to list all running processes and their IDs

Code:
ps aux
Then use the kill command to stop the process.
Code:
kill <pid of program to kill>
Cheers,

Evo2.
 
Old 12-01-2009, 05:37 AM   #22
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
thanks guys everything is as i want it to be
 
Old 12-02-2009, 07:11 AM   #23
Germanchu
LQ Newbie
 
Registered: Nov 2009
Location: Buenos Aires, Argentina
Distribution: Gentoo
Posts: 23

Rep: Reputation: 0
Use screen... You can run a screen session on the server and keep any process running inside it as long as you want, without the risk of killing the process if the remote terminal gets disconnected. That's what I use with all my servers.

If you need to reconnect later, login into the server and do "screen -r", that will restore all the consoles you had when you left.

More info: http://www.gnu.org/software/screen

Best regards,
 
  


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
how to keep program running after closing ssh session fakie_flip Linux - Software 10 11-03-2011 09:33 AM
Keep snoop running even after closing terminal the_imax Solaris / OpenSolaris 3 11-14-2009 06:19 AM
running remote X applications via Putty from a Windows XP system John Sorkin Linux - Newbie 1 08-23-2008 11:19 PM
Closing ports 25 + 631 still running smtp and CUPS JZL240I-U Linux - Security 17 04-02-2007 07:07 AM
Will script continue to run even after closing putty for remote access anjanesh Linux - Newbie 11 08-07-2006 04:05 AM


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