A
A
Andrey2021-10-21 21:52:24
linux
Andrey, 2021-10-21 21:52:24

Transferring files between servers without my participation?

I'm trying to transfer files from one dedicated server to another using the scp -r command. I tried with the help of the running putty program, as well as through the Shell in the ISP manager. The files transfer fine until I close putty or the browser that has the ISP control panel open with the Shell client running.

I don’t understand, in order to transfer files from one server to another, I can’t turn off my home computer during the transfer? Can I somehow start copying without my participation? There are a lot of files, somehow I don’t really want to turn off the computer for a couple of days.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Sokolov, 2021-10-21
@dyba

the screen command will start an offline session from which you can disconnect and then reconnect.
In the session screen, no longer afraid to leave / disconnect, instead scp, it may be more convenient to use rsync- it zips, which can speed up the transfer:

rsync -avz /var/www/projectOldName  [email protected]://var/www/projectNewName

And press Ctrl + A- Dto leave the running Wirth. terminal and safely disconnect from SSH. Later, when you log in screen -ragain, reconnect to the abandoned session with the command.

D
Drno, 2021-10-21
@Drno

rcyns or rclone
add & to the end of the command and you can disable putti
Yes, by closing putti you close the user session, so all activity stops

S
Saboteur, 2021-10-22
@saboteur_kiev

When you disconnect from a session, you send a SIGHUP signal to your shell and all child processes (scp, rsync).
There are several workarounds on how to avoid this.
1. Run the process through nohup &
2. Use a session manager - screen or tmux
3. Run the process in the background and unbind it from your shell beforehand ( &; disown )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question