3

Vagrant RSYNC folders have options for changing the owner and group (owner, group, rsync__chown), but what about permission levels for both file and directory (dmode, fmode, rsync__chmod)?

It seems like the permissions for my synced folder are changing after every "vagrant rsync" command!

I am having trouble finding info for that command on their website. Any idea where I can find the documentation for that command?

Coffee123
  • 156
  • 2
  • 9

1 Answers1

2

In your Vagrantfile you can configure the permissions for the synced folder in the following manner:

config.vm.synced_folder "./", "/vagrant", 
  owner: "vagrant",
  group: "www-data",
  mount_options: ["dmode=775,fmode=664"]

In this way you can specify the permissions and dir/file modes so they are consistent when you vagrant rsync or vagrant rsync-auto.

Since you asked, here is the documentation for that command: https://www.vagrantup.com/docs/synced-folders/rsync.html

Luke
  • 3,985
  • 1
  • 20
  • 35