Synced folders with RSync

When using RSync as a synced folder option in Vagrant, it's a slightly more complex setup. RSync can be used when other options for file-syncing are not available, such as the other option we have looked at, basic usage, or in the next section, which is the NFS option.

To start using RSync, our Vagrant file just needs an extra parameter on the config.vm.synced_folders option:

config.vm.synced_folder ".", "/home/vagrant/files", type: "rsync"
To use this option, both the host machine and Vagrant machine must have rsync installed. Vagrant will attempt to install rsync on the Vagrant machine if possible, if not, it will display an error.

There are additional parameters available to use with the RSync option. Please view the official documentation for the most up-to-date list. These include the ability to exclude certain files.

RSync traditionally does a one-time sync from the host to guest machine unless the rsync_auto option is set to true in the Vagrantfile. This is the default value in Vagrant, but can be changed by setting the rsync_auto option to false.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.168.172