Merge pull request #4788 from kikitux/master

doc rsync - use sudo rsync for a restricted folder
This commit is contained in:
Seth Vargo 2014-11-05 16:17:23 -05:00
commit d20dea0037
1 changed files with 17 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, is unable to automatically install rsync for your operating system,
it will tell you. 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 ## Options
The rsync synced folder type accepts the following options: The rsync synced folder type accepts the following options:
@ -68,3 +72,16 @@ Vagrant.configure("2") do |config|
rsync__exclude: ".git/" rsync__exclude: ".git/"
end end
</pre> </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>