![]() Sometimes you don’t want to enter the password while backing up files from local to remote server. The format is you see above, it asks for password while doing rsync from local to remote server. You should also specify the destination directory on the remote server. While doing synchronization with the remote server, you need to specify username and ip-address of the remote server. Rsync allows you to synchronize files/directories between the local and remote system. Sent 42 bytes received 12380 bytes 3549.14 bytes/secĮxample 4. $ rsync -v /var/lib/rpm/Pubkeys /root/temp/ To copy only one file, specify the file name to rsync command, as shown below. r-r-r- 1 root bin 949 /var/opt/installation/inventory/sva.xml $ ls -l /var/opt/installation/inventory/sva.xml /root/temp/sva.xml Sent 26499 bytes received 1104 bytes 55206.00 bytes/secĪs you see below, rsync preserved timestamps during sync. Now, executing the same command provided in example 1 (But with the rsync option -a) as shown below: $ rsync -azv /var/opt/installation/inventory/ /root/temp/ Preserve timestamps during Sync using rsync -a r-r-r- 1 root bin 949 /root/temp/sva.xmlĮxample 2. r-r-r- 1 bin bin 949 /var/opt/installation/inventory/sva.xml As you see below, rsync didn’t preserve timestamps during sync. Now let us see the timestamp on one of the files that was copied from source to destination. $ rsync -zvr /var/opt/installation/inventory/ /root/temp To sync two directories in a local computer, use the following rsync -zvr command. Synchronize Two Directories in a Local Server ![]() In case of remote, specify the login name, remote server name and location. Source and destination could be either local or remote. Syntax $ rsync options source destination
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |