Rsync problems

Hi,

I am trying to build an rsync command on my mac to keep my Picture directory on my mac and

a directory in the Shared Picture folder in sync,

This does not work:

/usr/bin/rsync -a --delete /Users/jerry/Pictures/  </font>

root@nas:/shares/Public/‘Shared Pictures’/Pictures

The Quotes do not protect the blank in Shared Pictures and

a directory name Shared is created with the contents of the

Pictures directory from the Mac.

The same occurs if I use a “Double Quote”.

My sorta workaround is to create a symbolic link

ln -s “Shared Pictures”  SharedPics

On the nas and then use:

/usr/bin/rsync -a --delete /Users/jerry/Pictures/ </font>

root@nas:/shares/Public/SharedPics/Pictures

Seems a bit clumsy…

Anyone else have this problem?

Jerry


Hi yrrej,

I will solve your issue. But first, if you allow me, I would like to advise you NOT to activate the ssh access without sufficient knowledge on linux systems. You will just end up with a dead drive like so many people. When you establish a ssh connection to your drive, you get the following warning:

Failure to understand the Linux command line interface can result in rendering your network device inoperable, as well as allowing unauthorized users access to your network.

This is so true.

Sorry for the off-topic warning. Hopefully, it may benefit others.

Now, I will answer your question:

Let’s take the path you want to acces :

/shares/Public/Shared Pictures/Pictures

As you have experienced, the writing  /shares/Public/‘Shared Pictures’/Pictures  is wrong. You should either write:

"/shares/Public/Shared Pictures/Pictures" 

or

/shares/Public/** Shared\ Pictures/Pictures**

The use of the backslash character  \ before a special character like space to cancel its effect (herein separating command line arguments) is called escaping the character.

Now, to solve your problem (I believe you have a terminal open on your mac computer), you should write:

sudo rsync -avu --delete-after /Users/jerry/Pictures/ root@nas:"/shares/Public/Shared Pictures/Pictures"

If you need to cancel the command, press ctrl + c .

Hope this helps.

Hi,

Thanks for the reply :slight_smile:  It never occured to me to quote the whole string or use

the \ escape.

I realize the danger of root access, I have used Unix like systems for decades…

I was thinking about enabling ssh login for myself in the sshd_conf file in order to

lessen the danger trashing the file system.

I am not too worried about intruders, I am sitting behind a firewall with  port forwarding

for VPN and ssh access guarded by public key encryption.

I like the idea of rsync into order to keep volatile directories synched with the MyBookLive.

It is much more efficient that dragging and dropping whole directory folders.

Jerry

Ok. I see. Sorry for my reply. As the use of quotes and backslashes are pretty basic stuffs, almost always required, I assumed you had little experience. Sorry.

However, I totally agree with you on rsync. I use it to automatically replicate one MBL to another through my home network. Also when I need to start a copy and know that I will not be able to complete it owing to time constraints. rsync allows me to stop and resume later. But, beware, that despite what is advertised, rsync cannot copy everything about the files on your MAC. There may be data losses on rare and occasional situations.

TIP :

As a MAC user, you could greatly benefit of the following combination :

ssh-keygen + ln -s /shares /Volumes + Automator

Whoops,

just tried it out… I need the quotes around the target path *Plus* the backslash to protect the blan\k

in the file name.

Jerry

For me, I use '" ’  at the beginning and ’ "   at the end.