Copy from remote server to local server

rsync -ahvn username@hostname:/var/www/html/website* /var/www/html/website --max-size=10M

Explanation:

  • -a → By specifying , the file will be copied under the same conditions as the copy source file as much as possible.
  • -h → Improve the visibility of the file size.
  • -v → Output details.
  • -n → Check the target file.
  • --max-size → You can specify the upper limit of the file size to be transferred with .

Viewing file transfer status

rsync -ahv --progress username@hostname:/var/www/html/website* /var/www/html/website

If you specify --progress, the transfer status is displayed for each file.

Specify ssh port in rsync

#Option 1
rsync -e "ssh -p 2233"
#Option 2
rsync --rsh="ssh -p 2233"

Rsync options

 by the author.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Maciej

Maciej

623 Followers

DevOps Consultant. I’m strongly focused on automation, security, and reliability.