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

--

--

Maciej

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