SCP with Tar compression

You, UnixUbuntuSCP
Back

Do you have couple of Giga, Tera byes of data to transfer between servers?. Did you have to move your files in to a new server?. Did you try rsync, scp and those take a long time or timeout the session?.

Well, the solution is simple, you can compress the and send the output to the SCP stream.

From Server #1 to Server #2 and you logged in to Server #1

tar czf - /var/www/ | ssh server2@server2.com tar xzf - -C ~/

From Server #1 to Server #2 you have logged in to the Server #2

ssh server1@server1.com "tar czf - /var/www" | tar xzvf - -C /var/www
© Heshan Wanigasooriya.RSS

🍪 This site does not track you.