Skip to main content
  1. Posts/

Copying Large Files Over Ssh

·158 words·1 min·
linux
May Meow
Author
May Meow
MayMeow is a developer and cybersecurity enthusiast with a passion for cryptography, DevSecOps, and open-source contributions. They enjoy creating tools that strengthen digital security, blending creativity and technology to innovate in fields like PHP and .NET. Always exploring new frontiers in tech, MayMeow is dedicated to safeguarding the digital landscape through their work.
Table of Contents

If you tried to copy files via SSH you know that you can use scp to do this. For example:

SCP
#

scp you@1.2.3.4:/path/to/file.rar ./

# or to download folder
scp you@1.2.3.4:/path/to/folder ./

Most of the time, this solution works, but if you have an unstable connection, you have to start downloading files all over again. Even worse, if the file is large, it will take a long time to download.

I found another solution. Using a rsync.

RSYNC
#

Rsync can continue to download files in the event of connection problems.

rsync -r -P -e ssh you@1.2.3.4:/path-to/downloads/o .

Here are options from the example above:

  • -P means --partial --progress which ensure that partially downloaded files remain on the disk. This means that if you have connection problems, you do not have to download the files again.
  • -r it is same as --recursive and can be used when you downloading folders
  • -e specify the remote shell to use.
Reply by Email

Related

🐧 Securing Ssh for Linux
·263 words·2 mins
tutorial linux
My Selfhosting Workflow
·804 words·4 mins
linux WIP
Notes on Selfhosted Services
·400 words·2 mins
linux