0

I have estimated 44 GB of data from my web server. I want to transfer it to another server with less time. I am using Putty to transfer file. is there any way to achieve this? I don't know which commands to use but some blogs said to use rsync or scp to transfer these files. your help is greatly appreciated. I've tried scp from local to server but I what I need is from server to server.

  • Can you mention the OS of source and target servers? – Romeo Ninov Aug 10 '21 at 07:26
  • I am using Linux OS for web Servers – Peter Eris Aug 10 '21 at 08:01
  • Needs more details - "from server to server" - what server are you interactively logged on to? Are we talking about a single file, or multiple ones? What compression do you want, gzip? – Panki Aug 10 '21 at 08:39
  • 1
    Did you ask this question a second time? – Panki Aug 10 '21 at 08:42
  • Web server to another web server. I want to transfer all files inside of a directory compressed with zip. I am connected to a web server via putty and want to transfer these files to another web server/hosting. I think Migration is the right term for this one, sorry for the technical illiteracy. – Peter Eris Aug 10 '21 at 08:44
  • I've already asked this one on stackoverflow, showed me a link for rsync, tried it and had no success at all. – Peter Eris Aug 10 '21 at 08:45

2 Answers2

0

Both scp and rsync support compression and decompression at endpoints. You can pass -C to scp or -z to rsync

Transfer speeds might be a bit faster using scp because scp does not do a comparison of files between a source and destination.

I would suggest you check the man pages though for any other options you might want to use.

If you don't want decompression to happen at the remote, but just want to compress and transfer the compressed files on the fly, you might want to check this question. You can use another compression tool if you like.

Rsync uses zlib, which does a decompression. You might want to check this answer for more information how its related to zip and its differences.

The graph in the first answer of this question might also provide a better idea in terms of performance.

Erlis D.
  • 101
  • can I use both -r and -C in pscp? I am also transferring files inside directories and i want to transfer them at a less time consuming way – Peter Eris Aug 11 '21 at 02:18
  • Yes, you can. Each file will be compressed while being transferred. It will happen recursively. It probably will take some time because you're doing also compression. But the data usage will be smaller, and as a result transfer will be faster. – Erlis D. Aug 11 '21 at 08:33
0

If you want to suppress any overhead related to L4-L6 protocols, you can use netcat:

On destination server side:

nc -l -p XXXX > archive.tar.xz

On uploading server side:

tar -cJf - /var/www | nc destination_server XXXX

Keep in mind that using that method, traffic is clear

binarym
  • 2,649