I've noticed some issues with rsync and .gvfs over the years. Typically I just --exclude=.gvfs
in my rsync command and call it a day.
Recently I decided to read the rsync man page top to bottom left to right. After all, what better way to learn? Man pages are quicker than Googling, if you ask me. I had noticed the -x
flag, which was cited to not cross other file systems. I began to wonder what exactly that meant and thought... would -x
also ignore .gvfs
, being a virtual file system?
That said, would:
rsync -a --exclude=.gvfs /home/jason /media/externalhdd
(be kind of the same as)
rsync -ax /home/jason /media/externalhdd
????
Yes, it should be the same.
To check for sure: run
stat
on your two directories:/home/jason
and/home/jason/.gvfs
. Thestat
output will show a "device" entry:-- it's the first item in the third line. The number is shown twice: in hex ('h' suffix), and in decimal ('d' suffix).
If these numbers are different between the two directories, they're considered to be on different device, so the
-x
option will prevent rsync from traversing to this directory.I did a quick test on Ubuntu 18.04 and
-x
does not exclude.gvfs
.