I did add a PR for the documentation to add this example since is quite
handy

https://github.com/mitchellh/vagrant/pull/4788

Alvaro.

On Thu, Nov 6, 2014 at 8:54 AM, Alvaro Miranda Aguilera <[email protected]>
wrote:

>
> On Thu, Nov 6, 2014 at 1:10 AM, San <[email protected]> wrote:
>
>> *config2.vm.synced_folder "./scripts", syncDir+"/scripts", type: "rsync",
>> rsync__exclude: "*.json", *
>> *                                                          rsync__args:
>> ['--verbose', '--rsync-path="sudo rsync"']*
>
>
> Worked for me.
>
> 1. you have config2. os that correct?
>
> 2nd. you are not telling rsync to include/follow directories, so you
> should add --archive at least.. but match -abvz will work... you have -v
> only in the vagrantfile
>
> try to remove /root/p1/scripts and let this to create on first run..
>
> my output:
>
> z2-3:oracle7 kikitux$ vagrant reload --provision
>
>
> ==> default: Attempting graceful shutdown of VM...
>
>
> ==> default: Checking if box 'kikitux/oracle7' is up to date...
>
>
> ==> default: Clearing any previously set forwarded ports...
>
>
> ==> default: Fixed port collision for 22 => 2222. Now on port 2200.
>
>
> ==> default: Clearing any previously set network interfaces...
>
>
> ==> default: Preparing network interfaces based on configuration...
>
>
>     default: Adapter 1: nat
>
>
> ==> default: Forwarding ports...
>
>
>     default: 22 => 2200 (adapter 1)
>
>
> ==> default: Booting VM...
>
>
> ==> default: Waiting for machine to boot. This may take a few minutes...
>
>
>     default: SSH address: 127.0.0.1:2200
>
>
>     default: SSH username: vagrant
>
>
>     default: SSH auth method: private key
>
>
>     default: Warning: Connection timeout. Retrying...
>
>
> ==> default: Machine booted and ready!
>
>
> ==> default: Checking for guest additions in VM...
>
>
> ==> default: Rsyncing folder:
> /Volumes/hd1/Dropbox/vagrant_z2-3/oracle7/scripts/ => /root/p1/scripts
>
>
> ==> default:   - Exclude: [".vagrant/", "*.json"]
>
>
> ==> default: Mounting shared folders...
>
>
>     default: /vagrant => /Volumes/hd1/Dropbox/vagrant_z2-3/oracle7
>
>
>
> z2-3:oracle7 kikitux$ ls scripts/
>
>
> this_will_copy.txt      this_wont_copy.json
>
>
>
> z2-3:oracle7 kikitux$ vagrant ssh -c "sudo find /root/p1"
>
>
> /root/p1
>
>
> /root/p1/scripts
>
>
> /root/p1/scripts/this_will_copy.txt
>
>
> Connection to 127.0.0.1 closed.
>
>
> z2-3:oracle7 kikitux$
>
>
> The Vagrantfile i did.
>
> # -*- mode: ruby -*-
> # vi: set ft=ruby :
>
> # Vagrantfile API/syntax version. Don't touch unless you know what you're
> doing!
> VAGRANTFILE_API_VERSION = "2"
>
> Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
>   config.vm.box = "kikitux/oracle7"
>   syncDir="/root/p1"
>   config.vm.synced_folder "./scripts", syncDir+"/scripts",
>     type: "rsync",
> rsync__exclude: "*.json",
> rsync__args: ["--verbose", "--rsync-path='sudo rsync'", "--archive",
> "--delete", "-z"]
> end
>
> Alvaro.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to