![]() |
|
|
|
| Visit OverClockers.com |
|
||||||||||||||||||||||
|
|
|
|
|
Welcome to the Overclockers Forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. If you would prefer not to see any double-underlined words and corresponding advertisements without registering or logging in, place your cursor here for ContentLink
|
|
|
Thread Tools |
|
|
#1 |
![]() Registered Join Date: Jan 2006
|
[Linux Command line] problem
Dear linux experts , I am having a little problem : i have a machine which i access through ssh. And i want it to run a task for me. This is all great but when i want to close the ssh connection the task also stops. How do i close the connection and still have the machine i ssh into run my task. i have heard something about 'at' but have not found the proper syntax to make it work. ![]() Thanks in advance Ve'r |
|
|
|
|
|
#2 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Cyber Deals Content Editor once you 'clock, you can't go stock Senior Join Date: Apr 2002
Location: at home
|
you can use screen http://linux.die.net/man/1/screen
__________________
______________________________/\/\__________________/\/\_____ _______/\/\/\/\__/\/\/\/\____/\/\____/\/\/\______/\/\/\/\/\__ ____/\/\/\/\____/\/\__/\/\__/\/\________/\/\______/\/\_______ _________/\/\__/\/\/\/\____/\/\____/\/\/\/\______/\/\________ __/\/\/\/\____/\/\________/\/\/\__/\/\/\/\/\____/\/\/\_______ _____________/\/\___________once you clock you can't go stock PM me with your Cyber Deals articles and/or ideas to get published on the front page of Overclockers.com |
|
|
|
|
|
#3 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Overclockers AltOS Content Editor Join Date: Jan 2006
Location: Ontario Canada
|
Well technically using the ampersand ( & ) should background the process so that once you close the connection it continues to work. so like Code:
sudo apt-get update & However, while this works in Redhat, I have found that it does not work in Ubuntu for some reason. you can use nohup instead. It will do exactly what you need
__________________
HEAT Those wishing to contribute to the AltOS section front page please PM me. Leviathan41: "Playing with a controller because the mouse and keyboard is too easy is like racing with a bicycle because a car is too fast." |
|
|
|
|
|
#4 | |
![]() ![]() ![]() ![]() ![]() ![]() ![]() Member Join Date: Mar 2005
Location: Austin, Texas
|
Quote:
__________________
"Save yourself a lot of trouble and get a Mac. Get HP. Get an abacus. Anything but Gateway." |
|
|
|
|
|
|
#5 |
![]() Registered Join Date: Jan 2006
|
I have my tasks running as we speak , it is unaffected by my ssh connection ![]() Thanks splat,Stratus_SS & Trombe |
|
|
|
|
|
#6 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() Member Join Date: Dec 2008
Location: Nebraska
|
__________________
MINE: 3800X2 @3.0 w\ CNPS7700, SLIDR, 2GB RAM, 8800GTS, 74GB Raptor, A2ZS, Antec 300, PCPC 510, Gentoo x64;
HERS: E5300 @3.6 w/ noctua, UD3P, 8GB RAM, GTX260, Seagate 320GB 7200.10, Panzer Box, OCZ 600, Win 7 x64; AUDIO : Little Dot I+ w/ Mullard M8161 Small Shield Tubes, Grado SR325i w/ G Cushion Pads ("Bagels") |
|
|
|
|
|
#7 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Senior Member Join Date: Feb 2003
Location: CT
|
The & will run it in the background, but the terminal is still the parent process, so when the parent process is killed, the process dies. You should use nohup. Do a "man nohup"... basically it just says keep this process running even if the parent process is closed.
__________________
I do not support inline advertising in my posts!!! Click to read more. I do not endorse any of the products, services or websites in the contextual ads being inserted in my posts. I urge you to refuse to support any company that uses these ads, and to use Mozilla Firefox and Adblock Plus (both freely available from the Firefox homepage) to block all such ads. The decision to include inline ads was made by iNet in direct violation of previous promises to the contrary, not by the administrators, moderators or other dedicated, volunteer forum staff who have always worked hard to maintain the integrity of the website and ensure a positive user experience. |
|
|
|
|
|
#8 |
![]() Registered Join Date: Jan 2006
|
Indeed i am using the 'nohup' solution. |
|
|
|
|
|
#9 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Cyber Deals Content Editor once you 'clock, you can't go stock Senior Join Date: Apr 2002
Location: at home
|
screen lets you recall it to the foreground, like if you were running a game server. running a counter strike server was my first experience with screen and really the only time i needed it.
__________________
______________________________/\/\__________________/\/\_____ _______/\/\/\/\__/\/\/\/\____/\/\____/\/\/\______/\/\/\/\/\__ ____/\/\/\/\____/\/\__/\/\__/\/\________/\/\______/\/\_______ _________/\/\__/\/\/\/\____/\/\____/\/\/\/\______/\/\________ __/\/\/\/\____/\/\________/\/\/\__/\/\/\/\/\____/\/\/\_______ _____________/\/\___________once you clock you can't go stock PM me with your Cyber Deals articles and/or ideas to get published on the front page of Overclockers.com |
|
|
|
|
|
#10 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Senior Member Join Date: Sep 2002
Location: indianapolis, indiana
|
+1 for screen. i am a big fan of being able to resume a session, especially since i am trying a LFS (linux from scratch) install and only work on it a bit at a time. much easier to be able to close out my ssh session and reestablish right where i left off.
__________________
core2quad case/psu - antec p182 gun metal black w/fortron fx600-gln 600w mobo - asus p5k premium/wifi-ap cpu/hsf - intel core 2 quad q6600 b3 (sl9um) 2.4 @ 3.0 (9*333) w/asus v-60 vapo bearing hsf ram - 4 x 1gb pc2 8500 5-6-6-18 hdd - 2 x seagate barracuda 7200.10 320 gb sata (raid 0) & 1 x seagate barracuda 200 gb ide gpu - msi geforce 8800gts 640 mb os - gentoo amd64, windows vista ultimate x64, & windows 7 (7000) x64 heatware | mbentley.net | ocf geforce survey |
|
|
|
|
|
#12 |
|
New Member Join Date: Jul 2009
Location: Bryan, TX
|
Screen is by far the best solution for this. You have all the benefits of running interactively, but it won't stop if you close your connection, *and* you can reconnect later to check on it. |
|
|
|
|
|
#13 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() Member Join Date: May 2009
Location: Humboldt
|
Really? I've started FAH on ubuntu 9.04 with & over ssh and had it still running later. Least i checked an hour later and it was still running. I'll have to test again i guess.
__________________
E5200@3.7(337x11)@1.37vcore on Xig. HDT-s1283 Asus P5Q Pro w/modded bios 2x2gb OCZ ddr2-1124 5-5-5-15@1.8v(highly recommended! OCZ2P1066LV4GK) 320gb WD hdd CORSAIR CMPSU-400CX Sapphire 4830 w/ hacked up S1 V2+486 HSF ramsinks@700/1200 Old (~2002) ATX case Ubuntu 9.04 64bit w/XP32 for gaming. My heat. |
|
|
|
|
|
#14 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Senior Member Join Date: Feb 2003
Location: CT
|
That's different... you ran a script that started fah... you can start/stop daemons using ssh and they continue after the shell has exited.
__________________
I do not support inline advertising in my posts!!! Click to read more. I do not endorse any of the products, services or websites in the contextual ads being inserted in my posts. I urge you to refuse to support any company that uses these ads, and to use Mozilla Firefox and Adblock Plus (both freely available from the Firefox homepage) to block all such ads. The decision to include inline ads was made by iNet in direct violation of previous promises to the contrary, not by the administrators, moderators or other dedicated, volunteer forum staff who have always worked hard to maintain the integrity of the website and ensure a positive user experience. |
|
|
|
| Thread Tools | |
|
|
|
|||||||||
|