Linux: rsync: Backup remote folder into local folder

PHOTO EMBED

Sun Aug 28 2022 22:18:41 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #bash

$ rsync -avz -e "ssh -p <ssh port number>" <user>@<remote addr>:<remote path/folder> <local path/folder>
content_copyCOPY

It makes a backup of remote folder in local folder by synchonizing folder content. Example: > rsync -avz -e "ssh -p 22000" root@192.168.13.100:/var/www/ /home/myuser/remote_backup_www it creates a backup of remote folder "192.168.13.100:/var/www" in local folder "/home/myuser/remote_backup_www" using ssh port 22000. if local folder "/home/myuser/remote_backup_www" does not exists, it is created.