[mdlug] Proper rsync syntax

email5000 at usa.com email5000 at usa.com
Mon Jun 15 21:08:56 EDT 2020


I 'rsynced' a root directory from one NAS drive to another drive in the
same NAS box, but I think I made a mistake in my syntax. The 'from'
drive is referenced as /mnt/sdb2, and the other we'll call
/mnt/Workspace. The intent is to have the root of sdb2 as the root of
Workspace, but what happened is that rsync copied the folder (i.e.
partition) sdb2 over to Workspace, and now I have an extra level of
hierarchy in Workspace, with an empty root partition in the destination
drive except one folder called sdb2. That is: the content of destination
root folder sdb2 contains what I want to be the root of the destination.
I realize that it's not critical, but I don't particularly want a folder
in the root of Workspace called sdb2, and the extra hierarchy just makes
it obsolete/redundant.

With the pwd as: /mnt, I think my syntax was:  rsync -tvr ./sdb2 ./Workspace

Did I miss a slash somewhere ... like after sdb2 ?

My thinking to fix this is either 'move' all of sdb2 back to the root,
or simply wipe the sdb2 folder and go again with rsync. I'm thinking
there is not a quicker, easier way to do this.

Comments?

BTW: For future reference, what is the proper rsync syntax to copy the
'contents' of a folder over without copying the folder name itself?

Thanks.
-Rich Hall






More information about the mdlug mailing list