a - rsync command rsync is a powerful command used to transfer files over network It can copy files between local and remote systems and synchronize directories. It supports various options to control the transfer process common options: a → archive mode, preserves permissions, timestamps etc v → verbose mode z → compress data during the transfer P → show progress and where possible supports pausing and resuming e → specifies an alternative remote shell to use (-e ssh) Syntax: rsync [options] [src] [user@]host:targ rsync [options] [user@]host:src [targ]
b - rsync examples rsync -av /home/kr/cli /home/kr/clibkp → local copy rsync -avz user@192.168.1.100:/home/kr/cli /home/kr/clibkp → copies everything from remote to local machine rsync -av --delete /home/kr/cli user@192.168.1.100:/home/kr/cli → syncronise directories and delete files in destination if not exists in source rsync -avzP /home/kr/cli user@192.168.1.100:/home/kr/cli → pause with Ctrl+c and resume with the same command if you frequently use rsync between two machine, use SSH key based authentication ssh-keygen -t rsa -b 4096 -C "your_email@example.com" → generates a key pair ssh-copy-id user@remote_host → copies the public key to remote machine you can use rsync now without asking for password all the time