LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-15-2022, 12:46 PM   #1
linuxiscoolerthaniam
LQ Newbie
 
Registered: Dec 2022
Posts: 13

Rep: Reputation: 0
getting a process from another session to the foreground


please consider the following.

from my desktop I log into a remote system as root

I do a long running rsync operation with progress indicator.

then while the operation is still going;

from my laptop I log into the same remote system as root.
There are no jobs I can fg to the foreground.

How do I get the rsync operation to the current session's foreground?
 
Old 12-15-2022, 01:56 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,153
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Quote:
from my desktop I log into a remote system as root
How? Did you ssh over. When you close a shell, the processes will quit too.

Quote:
There are no jobs I can fg to the foreground.
What did you do? Did you background a process, or detach it from the shell? You can background a process then bring it to the foreground.

You'll need to give a lot more info on what you did or are trying to do.

Quote:
How do I get the rsync operation to the current session's foreground
?

Edit:
https://linuxconfig.org/bash-backgro...ess-management

Last edited by teckk; 12-15-2022 at 01:59 PM.
 
Old 12-15-2022, 02:47 PM   #3
linuxiscoolerthaniam
LQ Newbie
 
Registered: Dec 2022
Posts: 13

Original Poster
Rep: Reputation: 0
none of the above.

On my desktop I log into a remote server using ssh and start a process which I just leave running never logging out no nothing.

then I log into the same server using ssh on my laptop.

how do I get that process i started on my desktop to appear on my laptop's session to the remote server?
 
Old 12-15-2022, 03:51 PM   #4
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
You have to start a virtual session that can be reconnected. I believe the standard is the utility "screen". It will let you reconnect to
the session.
 
1 members found this post helpful.
Old 12-16-2022, 09:02 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,793

Rep: Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952
Every time you log into the server your starting a new session and therefore the session on the desktop is different from the session on the laptop. It is like opening multiple terminal windows on your desktop.

Normally a process running in one session is "attached" to that session. In order to see it running in another session it has to be detached. As posted you can use screen to detach the rsync process from the desktop and then be able to reattach from the running session on the laptop.

https://www.howtogeek.com/662422/how...creen-command/
 
Old 12-16-2022, 02:05 PM   #6
linuxiscoolerthaniam
LQ Newbie
 
Registered: Dec 2022
Posts: 13

Original Poster
Rep: Reputation: 0
thx guys, I'll look into this screen utility. looks exactly what I am looking for.
 
Old 12-16-2022, 02:22 PM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,772

Rep: Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770
I use screen, but tmux can also be used for this. You might want to look at both to see which fits your workflow better.
 
  


Reply



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
Unable to launch "cinnamon-session-cinnamon" X session "cinnamon-session-cinnamon" -found; Falling back to default "session." xxxindigo Linux Mint 22 09-01-2019 09:21 AM
Can I fork a foreground child process in a background process? henryyao Linux - Newbie 1 09-06-2013 03:32 PM
Recovering process to foreground after ssh session closed bujecas AIX 1 02-09-2010 08:58 AM
Bash child process in foreground while parent dies kborgnis Programming 3 11-09-2007 06:50 AM
How to know the foreground process group ID of another console ?? sreeramabsc Linux - General 0 01-30-2006 01:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 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
Open Source Consulting | Domain Registration