linux - Slashes and the rsync command -


i trying along same lines asked in question: rsync: how synchronize in both directions?

however, can't figure out whether or not should add slashes end of file path. i'm trying create alias command syncs contents of 2 directories go same name on 2 different servers. don't want 1 directory copied other (which aware possibility depending on how slashes @ end done).

what have is:

alias syncdirectories1 = 'rsync -tvur name@host:/users/me/directory/ /users/me/directory/' alias syncdirectories2 = 'rsync -tvur /users/me/directory/ name@host:/users/me/directory/' 

for trying accomplish, should there slashes @ end of both file paths?

thank in advance help.

it's described in rsync(1) manpage.

a trailing slash on source changes behavior avoid creating additional directory level @ destination. can think of trailing / on source meaning "copy contents of directory" opposed "copy directory name", in both cases attributes of containing directory transferred containing directory on destination. in other words, each of follow‐ ing commands copies files in same way, including setting of attributes of /dest/foo:

rsync -av /src/foo /dest rsync -av /src/foo/ /dest/foo 

as destination, don't think has major consequences. there difference if source file , destination doesn't exist — command

rsync src dest 

will make copy of src called dest, whereas

rsync src dest/ 

will create directory dest , copy src file it.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -