V
V
Valery2014-10-23 10:27:12
ubuntu
Valery, 2014-10-23 10:27:12

Why does Vargant rsync delete a file from the guest machine?

Good afternoon,
so, there is Vagrant with the following config:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ubuntu/trusty32"
  config.vm.box_check_update = false
  config.vm.network "private_network", ip: "192.168.50.100"
  config.vm.synced_folder ".", "/vagrant", type: "rsync",
      rsync__exclude: ".git/",
      rsync__chown: true,
      rsync__args: ["--verbose", "--archive", "--delete", "-z", "--owner=vagrant", "--group=vagrant"],
      rsync__auto: true,
      owner: "vagrant",
      group: "vagrant"

  config.vm.provision "puppet" do |puppet|
    puppet.manifests_path = "manifests"
    puppet.manifest_file = "site.pp"
    puppet.module_path = "manifests/modules"
  end

  config.vm.provider "virtualbox" do |v|
    v.memory = 1536
    v.cpus = 1
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "95"]
  end
end

Rsync is installed via Cygwin and works in principle, but somehow in one direction. From host to guest (virtualka).
If I create a file on my computer, it is transferred to the virtual machine. But if Symfony2 creates files (for example, a cache) on the virtual machine, they are not transferred to me. And if there are no such files on my PC at all, then they are completely deleted from the virtual machine.
So, I'm trying to update Composer, but Rsync stupidly deletes the content from the Vendor folder. The symphony cache is also ugly deleted and the system periodically swears at the lack of files in the cache.
How can this be overcome? I feel that somewhere I messed up with the Rsync setting, because. hadn't used it before.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valery, 2014-10-23
@Akuma

If you remove the --delete flag, then the files are not deleted.
But how now to set up reverse synchronization? So that files created / updated on the guest machine are transferred back to me?

V
Vladimir Polishchuk, 2014-10-23
@NorthDakota

explainshell.com/explain/1/rsync

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question