Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore synced folder files/directories with NFS as sync system for Vagrant

Is there any way to make NFS to ignore specified files and/or directories from the synced folder? I have done it with rsync (rsync__exclude), but don't find any reference for NFS. I'm also looking for a solution for SMB. Any ideas?

like image 561
Manolo Avatar asked Jun 16 '15 19:06

Manolo


2 Answers

In my case I had to keep cache and log files unsynchronized, and the solution I found out was to create a symbolic link instead of the cache and log folders (e.g. app/cache and app/log) which points to a directory outside the synchronized folder (e.g. /home/vagrant/project/cache). Then, the files inside app/cache are not synchronized. Hope it helps.

like image 64
Manolo Avatar answered Nov 12 '22 03:11

Manolo


My rep isn't high enough to comment on the above answer, I had the exact same problem. I had to do a little work and figure this detail out:

The symlink must be in your virtual machine. So for example:

vagrant ssh
cd your/webapp
mkdir outside/your/webapp
ln -s outside/your/webapp cache

Now the symlink will show up in your project folder, but you won't actually be synchronizing any files across it.

like image 32
Mr. Hasquestions Avatar answered Nov 12 '22 04:11

Mr. Hasquestions