[mdlug] Fwd: Re: Proper rsync syntax
Raymond McLaughlin
rsm2599 at gmail.com
Tue Jun 16 01:04:40 EDT 2020
-------- Forwarded Message --------
Subject: Re: [mdlug] Proper rsync syntax
Date: Tue, 16 Jun 2020 00:55:28 -0400
From: Raymond McLaughlin <RSM2599 at gmail.com>
To: email5000 at usa.com
Much sympathy, Rich,
I often find my self flummoxed by rsync syntax, it never seems to do
what I want. This is why I usually use cp -a for jobs like that.
By the way,
mv Workspace/sdb2/* Workspace/
simply rewrites filesystem pointers, rather than actually "moving" data.
It should be nearly instantaneous, much faster than re-rsyncing.
I would follow up with
rmdir Workspace/sdb2
because rmdir will not remove non-empty directories- In case anything
(like dot files) got left behind.
-Ray
On 6/15/20 9:08 PM, email5000 at usa.com wrote:
> 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
>
>
>
>
> _______________________________________________
> mdlug mailing list
> mdlug at mdlug.org
> http://mdlug.org/mailman/listinfo/mdlug
More information about the mdlug
mailing list