Mastering Modern Linux, Second Edition by Paul S. Wang

Mastering Modern Linux, Second Edition by Paul S. Wang

Author:Paul S. Wang [Wang, Paul S.]
Language: eng
Format: epub, pdf
Publisher: CRC Press
Published: 2018-06-13T23:00:00+00:00


Remote File Synchronization

The rsync command makes it easy to keep files in sync between two hosts. It is very efficient because it uses a remote-update protocol to transfer just the differences between two sets of files across the network connection. No updating is performed for files with no difference. With the commands

rsync -az userid @ host:source destDir (remote to local sync)rsync -az source userid @ host:destDir (local to remote sync)

the given source file/folder is used to update the same under the destination folder destDir. When source is a folder, given without the trailing /, the entire hierarchy rooted at the folder will be updated. Use the form source / to sync all files inside the source folder to the destination folder.

The -az option indicates the commonly used archive mode to preserve file types and modes and gzip (Chapter 6, Section 6.11) data compression to save networking bandwidth. The rsync tool normally uses ssh (Section 7.6) for secure data transfer and does not require a password if you have set up password-less SSH between the two hosts (Section 7.6). For example, either one of these two commands

rsync -az [email protected]: /linux_book /projects

rsync -az [email protected]: /linux_book/ /projects/linux_book

updates the local folder /projects/linux_book based on the remote folder /linux_book by logging in as pwang on the remote host tiger.zodiac.cs.kent.edu. See the rsync man page for complete documentation.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.