Vagrant: rsync__auto option not syncing

Created on 28 Mar 2014  路  11Comments  路  Source: hashicorp/vagrant

I read in the documentation that there is an option for auto sync:

rsync__auto (boolean) - If false, then rsync-auto will not watch and automatically sync this folder. By default, this is true.

And I've configured synced folder like this:

config.vm.synced_folder "www", "/var/www",
            type: "rsync",
            rsync__auto: true,
            owner: "www-data"

But it doesn't work.

No sync is done until I run Vagrant command

vagrant rsync-auto

Any suggestions ?
I use Vagrant 1.5.1

Most helpful comment

Would it be reasonable to open a request for this option (or another) to actually start and stop rsync-auto appropriately? When the shared folder contains code to be edited, it's more likely than not that you'll want to always sync it, in which case it's a bit inelegant for starting and stopping the VM to require two commands apiece.

All 11 comments

On Sat, Mar 29, 2014 at 4:05 AM, Mirza Pasic [email protected]:

vagrant rsync-auto

i think that is the way

http://docs.vagrantup.com/v2/cli/rsync-auto.html

To ensure that the command works properly, you should start rsync-auto only
when the machine is running, and shut it down before any machine state
changes.

@kikitux is correct, working as intended.

Would it be reasonable to open a request for this option (or another) to actually start and stop rsync-auto appropriately? When the shared folder contains code to be edited, it's more likely than not that you'll want to always sync it, in which case it's a bit inelegant for starting and stopping the VM to require two commands apiece.

+1 to have rsync-auto auto started and stopped.

+1. It's easy to forget to always run the rsync-auto command, kind of a hiccup in the workflow. I've made this a little slicker by starting up my vagrant dev session using an alias:

$ vagrant rsync-auto > /dev/null & vagrant ssh && fg

This makes rsync drop in to the background and stay quiet while I run my VM. When I exit the VM it returns me to the rsync process and I can ctrl-c to kill it.

I concur, rsync-auto should be automatically started/stopped

+1 for auto start/stop. Can be configurable.

+1 for this feature.

Also, if I understood well, at the moment the option's goal is to enable auto-syncing when the 'vagrant rsync-auto' is ran, right? In this case, mentionning the cli command in the rsync__auto option may be useful, until the feature may be added. As it is written now it seems that enabling rsync__auto suffices to turn auto sync on.

I was burned by misunderstanding this, as well. I'm not sure what rsync__auto is even useful for in its current form; It seems intuitive that its purpose would be to instruct vagrant to run rsync-auto in the background for you while the box is running.

Good luck, it's not the first issue like this which I see closed without a proper fix/solution offered. I would suggest revising issue review/closing process.

I must have misunderstood the purpose of rsync_auto in the synced folder configuration option in the vagrant file. I assume that it is only for disabling the auto-sync command to work on the chosen folder.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OtezVikentiy picture OtezVikentiy  路  3Comments

RobertSwirsky picture RobertSwirsky  路  3Comments

DreadPirateShawn picture DreadPirateShawn  路  3Comments

cbednarski picture cbednarski  路  3Comments

bbaassssiiee picture bbaassssiiee  路  3Comments