Download files from VPS
On this page
I'm hosting a few Statamic (a file-based CMS) sites on a Hetzner VPS, and I wanted to download the files locally.
My first choice was scp
and I ended up with something like this:
scp -r ploi@5.161.177.151:/home/ploi/[website_folder]/users/ ~/Documents/Projects/[local_project_folder]/
But on one of the sites, I have A LOT of files and scp
is single-threaded and took forever.
So, I decided to look into rsync
and came up with this
rsync -avz -e ssh ploi@5.161.177.151:/home/ploi/[website_folder]/content/ ~/Documents/Projects/[local_project_folder]/content/
Here's an overview of the command above:
-a
: Archive mode. It preserves symbolic links, permissions, timestamps, and more.-v
: Verbose mode. It shows you detailed output during the transfer.-z
: Enables compression during the transfer.-e ssh
: Specifies that SSH should be used for the data transfer.
In the end, using rsync
made the files sync 5x faster!