doc rsync - suggest sudo for restricted folder
This commit is contained in:
parent
a5b576f0cd
commit
f93ba01770
|
@ -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:
|
||||||
|
@ -58,6 +62,7 @@ The rsync synced folder type accepts the following options:
|
||||||
pattern. By default, the ".vagrant/" directory is excluded. We recommend
|
pattern. By default, the ".vagrant/" directory is excluded. We recommend
|
||||||
excluding revision control directories such as ".git/" as well.
|
excluding revision control directories such as ".git/" as well.
|
||||||
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
The following is an example of using RSync to sync a folder:
|
The following is an example of using RSync to sync a folder:
|
||||||
|
@ -68,3 +73,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>
|
||||||
|
|
Loading…
Reference in New Issue