You are not logged in.

#1 2014-04-02 08:29:56

fukin_jim
Member
Registered: 2013-02-27
Posts: 20

[solved] rsync to usb drive over ssh

I am trying to set up a nightly backup and am running into an issue.  What I am trying to do is use rsync via ssh to perform the backup.  That works just fine, but where I run into problems is when I try to write to write to a removable ntfs drive mounted in media via udiskie.  I am getting a permissions error:

# rsync -a --delete test server:/media/My\ Passport/
rsync: mkdir "/media/My" failed: Permission denied (13)
rsync error: error in file IO (code 11) at main.c(656) [Receiver=3.1.0]

It also appears that it will not recognize the escape character. 

I have also tried to use an ext4 usb drive with simillar results:

# rsync -a --delete test server:/media/stick
rsync: recv_generator: mkdir "/media/stick/test" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.0]

I am assuming I need to change some permissions somewhere, but I'm not sure where exactly.  Could someone point me in the right direction?

Last edited by fukin_jim (2014-04-02 16:43:02)

Offline

#2 2014-04-02 09:45:47

ghen
Member
From: Belgium
Registered: 2010-08-31
Posts: 124

Re: [solved] rsync to usb drive over ssh

It's not a permission problem, but a problem of escaping the space; the remote host is trying to write to "/media/My".

The backslash you enter on the command line is escaping the space for the local shell (to interpret is as a single argument instead of two).  You probably need to double escape it – both the backslash and the space! – for the remote host as well.  Try either server:/media/My\\\ Passport/, or just "server:/media/My\ Passport/" with the quotes included.

Offline

#3 2014-04-02 16:43:59

fukin_jim
Member
Registered: 2013-02-27
Posts: 20

Re: [solved] rsync to usb drive over ssh

Many thanks, that fixed it.

Offline

Board footer

Powered by FluxBB