scp transfer (from one remote server to another), that is quite big.
So maybe I want close the computer from which I executed this command, will this end the transfer? I have
ssh access to the shell using the program Bitwise.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
There are a number of solutions.
scptransfer as usual.
exit) and the process will continue to run on the remote machine.
One disadvantage to this approach is that the file descriptors for stdout and stderr will still contain references to your ssh session's tty. The terminal may hang when you try to exit because of this. You can work around this by typing
~. to force close your ssh client (that escape sequence must follow a new line...see also
~?). If the process you are abandoning writes to stdout or stderr, the process may exit prematurely if the tty buffer overfills.
GNU Screen can be used to create a remote terminal session, which can be detached and continue to run on the server after you log out of the session. You can then log back into the server at a later date and reattach to the session.
screen -D -R <session_name>.
scptransfer as usual.
To reattach to the session:
screen -D -R <session_name>
See the answer using
This is the best solution if this is a periodic sort of task that you want to automate.
You could use
nohup(1), i.e., do something like:
nohup scp alice@source:/the/answer/of/all email@example.com:/var/tmp/42 &
This will create an output of
nohup.out. Then you can safely logout.
Yes, it will be terminated. The solution to maintain terminal session alive without connectivity is the
SCREEN(1) SCREEN(1) NAME screen - screen manager with VT100/ANSI terminal emulation SYNOPSIS screen [ -options ] [ cmd [ args ] ] screen -r [[pid.]tty[.host]] screen -r sessionowner/[[pid.]tty[.host]] DESCRIPTION Screen is a full-screen window manager that multiplexes a physical ter‐ minal between several processes (typically interactive shells). Each virtual terminal provides the functions of a DEC VT100 terminal and, in addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.g. insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text regions between windows.
As said above, you can use the screen command, for example:
user@server:~$ screen -S bigscptransfer
ser@server:~$ scp bigfile.dat server2:.
[detached from 5899.bigscptransfer]
user@server:~$ screen -r bigscptransfer