From f93ba01770726342b1f78d6f5c3601dfb8511ad6 Mon Sep 17 00:00:00 2001 From: Alvaro Miranda Date: Wed, 5 Nov 2014 12:43:46 -0800 Subject: [PATCH 1/2] doc rsync - suggest sudo for restricted folder --- .../source/v2/synced-folders/rsync.html.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/website/docs/source/v2/synced-folders/rsync.html.md b/website/docs/source/v2/synced-folders/rsync.html.md index 7393baa9a..f6970ec71 100644 --- a/website/docs/source/v2/synced-folders/rsync.html.md +++ b/website/docs/source/v2/synced-folders/rsync.html.md @@ -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 + +## 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 + +
+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
+
From 808008953f6a68ad253b24950b26168c990cc72b Mon Sep 17 00:00:00 2001 From: Alvaro Miranda Date: Wed, 5 Nov 2014 12:45:28 -0800 Subject: [PATCH 2/2] doc rsync - suggest sudo for restricted folder --- website/docs/source/v2/synced-folders/rsync.html.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/source/v2/synced-folders/rsync.html.md b/website/docs/source/v2/synced-folders/rsync.html.md index f6970ec71..62e88d0dd 100644 --- a/website/docs/source/v2/synced-folders/rsync.html.md +++ b/website/docs/source/v2/synced-folders/rsync.html.md @@ -62,7 +62,6 @@ 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: