Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

rsync and .gvfs folder problem

  Date: Jan 23    Category: Unix / Linux / Ubuntu    Views: 1009
  

I am trying to use rsync to perform synchronization of files remotely
from one Ubuntu 10.04 64-bit system to another.

I thought I had everything together based on several postings on the web
and it looked like it was about to work when I ran into a problem with
permissions to a folder, named .gvfs.

The terminal session command and messages follow:

mike@mike-gateway-laptop:~$ sudo rsync -azvv -e ssh /home/
mike@...:/mike_laptop_home/
opening connection using: ssh -l mike 192.168.1.101 rsync --server
-vvlogDtprze.iLsf . /mike_laptop_home/
mike@...'s password:
sending incremental file list
rsync: readlink_stat("/home/mike/.gvfs") failed: Permission denied (13)
rsync: mkdir "/mike_laptop_home" failed: Permission denied (13)
rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(601)
[sender=3.0.7]

Anyone out there have a fix to this problem?

Share: 

 

8 Answers Found

 
Answer #1    Answered On: Jan 23    

The simple answer is to use one of rsync's --exclude options to not try
and sync that folder. .gvfs is part of Gnome's desktop virtual
filesystem, allowing access to things like Samba, FTP, webDAV and so on
to any older applications you might be using which don't use the now
standard URI interface to these services. It's not something you'd want
to sync, even if the system would let you

 
Answer #2    Answered On: Jan 23    


I tried it, but got the same failure. See below.

mike@mike-gateway-laptop:~$ sudo rsync -azvv -e ssh --exclude
'/home/mike/.gvfs' /home/ mike@...:/mike_laptop_home
opening connection using: ssh -l mike 192.168.1.101 rsync --server
-vvlogDtprze.iLsf . /mike_laptop_home
mike@...'s password:
sending incremental file list
rsync: readlink_stat("/home/mike/.gvfs") failed: Permission denied (13)
rsync: mkdir "/mike_laptop_home" failed: Permission denied (13)
rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(601)
[sender=3.0.7]

Did I still do something wrong?

 
Answer #3    Answered On: Jan 23    

We learn something new every day :-)

Thanks to this, I have now discovered that rsync treats all --exclude
paths as relative to the source directory, so the exclude you've used -
which I would have fully expected to work - actually translates in rsync
as '/home/home/mike/.gvfs'.

Try

sudo rsync -azvv -e ssh --exclude 'mike/.gvfs' /home/
mike@...:mike_laptop_home

and see how that works.

And thank you for teaching me something new

 
Answer #4    Answered On: Jan 23    

That did change things. Now I get a different problem:

mike@mike-gateway-laptop:~$ sudo rsync -azvv -e ssh --exclude
'mike/.gvfs' /home mike@...:/mike_laptop_home
[sudo] password for mike:
opening connection using: ssh -l mike 192.168.1.101 rsync --server
-vvlogDtprze.iLsf . /mike_laptop_home
mike@...'s password:
sending incremental file list
[sender] hiding file home/mike/.gvfs because of pattern mike/.gvfs
rsync: mkdir "/mike_laptop_home" failed: Permission denied (13)
rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(601)
[sender=3.0.7]older

The folder /mike_laptop_home exists in the default path specified for
rsync. Why does rsync try to create one?

 
Answer #5    Answered On: Jan 23    

What are the permissions of that folder? Does the user you're logging
in as over SSH have permissions to write to that folder?

You say that the folder exists in the default path specified for rsync
(I'm not 100% sure what you mean by that), but you're not specifying it
for rsync in that command, you're specifying it for SSH - SSH is telling
rsync to sync to a directory with absolute path /mike_laptop_home. Is
this really what you're trying to do?

Other than that, I'm not sure and as it's now gone midnight over here
and I'm too tired to think straight, I'm afraid I'm off to bed :-)

I'll have a look at this tomorrow when my head'll (hopefully!) be a bit
clearer :-)

 
Answer #6    Answered On: Jan 23    

Interesting question. I can add files to that folder when logged onto
the server. My id is actually the same on both the client and the server.

The default path is specified in rsync.conf on the server. I want it to
be a large USB connected hard drive on the server.

I have been unable to chmod the permissions for the directory on the USB
device.

I've been doing some searching around and it looks like I may have to
add an entry in /etc/fstab to set that up properly (still reading about
that).

 
Answer #7    Answered On: Jan 23    

I think that's the problem. There's a disconnect between what SSH is
doing and what you want rsync to do. The SSH part of the command is
trying to connect you to a folder called mike_laptop_home at the root
level of the client PC and rsync then tries to write there rather than
to the USB drive.

I have to say that, while I use both rsync and SSH, I've never actually
tried to use rsync over SSH, so I'm not 100% certain, but from what I
can see, you need to specify the path you want to sync to in the SSH
connection, rather than relying on paths set in rsync.conf.

So your command should be something along the lines of

sudo rsync -azvv -e ssh --exclude 'mike/.gvfs' /home
mike@...:/full/path/to/rsync/to

If you're want to get the USB drive to always mount at a given point and
with the same permissions, then I'm afraid that fstab is not the way to
go - fstab is really meant for fixed rather than removable drives. At
this point, you have two ways to go. The simplest is to just give the
disk a label and it will always mount at /media/label - but from my own
experience, I can say that getting the permissions right is more of a
black art than a science.

The second way is more complex, but much more flexible and that's to use
udev. There's an excellent tutorial at
http://reactivated.net/writing_udev_rules.html but you need to be aware
that in one respect, Ubuntu does things slightly differently - where the
tutorial talks about using the udevinfo command to get the devices
attributes, Ubuntu uses the newer udevadm command. Just use the command

udevadm info --name=/dev/sdc --attribute-walk

to get your devices attributes (substituting /dev/sdc as appropriate for
your device).

 
Answer #8    Answered On: Jan 23    

You should be able to use sshfs to mount the remote folder locally, then use
rsync to move the files over. Might save some hassle. Best of luck,

 
Didn't find what you were looking for? Find more on rsync and .gvfs folder problem Or get search suggestion and latest updates.




Tagged: