Rsync, which stands for “remote sync”, is a remote and local file synchronization tool. It uses an algorithm that minimizes the amount of data copied by only moving the portions of files that have changed.
Here an example
# Use --dry-run to test the command
# Backup from remote to local
# Use --exclude to exclude the undesired folders
rsync <backup_user>@<domain_addr>:/<remote_folder>/ -aAXvh --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} <dest_folder>
# Backup from local to remote with custom ssh port on destination
rsync * -aAXvh -e "ssh -p <port>" user@hostname:/folder/
0 Comments