doc rsync - suggest sudo for restricted folder

This commit is contained in:
Alvaro Miranda 2014-11-05 12:43:46 -08:00
parent a5b576f0cd
commit f93ba01770
1 changed files with 18 additions and 0 deletions

View File

@ -35,6 +35,10 @@ can automatically install rsync into many operating systems. If Vagrant
is unable to automatically install rsync for your operating system,
it will tell you.
The destination folder will be created as the user initiating the connection,
this is `vagrant` by default. This user requires the appropiate permissions on
the destination folder.
## Options
The rsync synced folder type accepts the following options:
@ -58,6 +62,7 @@ The rsync synced folder type accepts the following options:
pattern. By default, the ".vagrant/" directory is excluded. We recommend
excluding revision control directories such as ".git/" as well.
## Example
The following is an example of using RSync to sync a folder:
@ -68,3 +73,16 @@ Vagrant.configure("2") do |config|
rsync__exclude: ".git/"
end
</pre>
## Rsync to a restricted folder
If required to copy to a destination where `vagrant` user doesn't have
permissions, use `"--rsync-path='sudo rsync'"` to run rsync with sudo on the guest
<pre class="prettyprint">
Vagrant.configure("2") do |config|
config.vm.synced_folder "bin", "/usr/local/bin", type: "rsync",
rsync__exclude: ".git/"
rsync__args: ["--verbose", "--rsync-path='sudo rsync'", "--archive", "--delete", "-z"]
end
</pre>