To add to Mario's excellent post,  if you're running --delete, don't
forget about --force to remove empty directories.

--Matt

On Wed, Feb 27, 2013 at 6:33 PM, unix_fan <[email protected]> wrote:
> My additional $0.02 on rsync use:
> 1. Use the -n flag first
> If you are an rsync neophyte, I strongly recommend using the -n flag first,
> to see what it would do without actually doing it. As in,
> rsync -nav SOURCE DESTINATION
>
> when you are satisfied that it will do what you expect, simply up-arrow and
> remove the "-n"
> To this day, I still do this approach, especially so if I include the
> --delete flag.
>
> 2. About that trailing slash business
> The following produce different results, and they are nuanced:
>
> rsync -nav SOURCE DESTINATION/
> rsync -nav SOURCE/ DESTINATION/
> rsync -nav SOURCE/ DESTINATION
> rsync -nav SOURCE DESTINATION
>
> If you have a hard time remembering the differences, it may be easier to
> start with the simple model of always using a trailing slash on both sides
> if the aim is to recursively copy SOURCE to DESTINATION where DESTINATION
> exists and is supposed to be a copy of SOURCE:
>     rsync -nav SOURCE/ DESTINATION/
>
> 3. exact copy
> For an exact copy, make sure you use the --delete flag.
>
>
> ________________________________
> From: Will Dennis <[email protected]>
> To: [email protected]
> Sent: Wednesday, February 27, 2013 2:07 PM
>
> Subject: Re: [lopsa-tech] Question on a Ubuntu ssh Copy and Case Sensitivty
>
> +1 on using rsync for this...
> Just transferred hundreds of GB from various USB sources to my new
> Synology DS413 via rsync, worked like a champ...
>
> rsync -arv /source/of/files/  /dest/path
>
> As Matt says, notice the trailing slash on the source, and the lack of
> one on the dest -- the source path's trailing slash means "do not create
> a folder with the name of the last directory spec'd in the source (in my
> example above, 'files') on the dest, and copy all the stuff into that,
> just (recursively) copy the files and folders in 'files' to the
> /dest/path"  (hopefully that makes sense...)
>
> Here is what the "-arv" option does:
> a = archive - means it preserves permissions (owners, groups), times,
> symbolic links, and devices.
> r = recursive - means it copies directories and sub directories
> v = verbose - means that it prints on the screen what is being copied
>
> HTH,
> Will
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> On Behalf Of Matt Lawrence
> Sent: Wednesday, February 27, 2013 4:55 PM
> To: [email protected]
> Subject: Re: [lopsa-tech] Question on a Ubuntu ssh Copy and Case
> Sensitivty
>
> On Wed, 27 Feb 2013, John BORIS wrote:
>
>> Is there any way to  get the Ubuntu machine to play by the rules? I
>> did see something on the Net that mentioned some copy bug and I am
>> wondering if this is it.
>
> I recommend you drop to the command line and use rsync.  Just remember
> that trailing slashes are significant.
>
> -- Matt
> It's not what I know that counts.
> It's what I can remember in time to use.
> _______________________________________________
> Tech mailing list
> [email protected]
> https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
> This list provided by the League of Professional System Administrators
> http://lopsa.org/
>
> _______________________________________________
> Tech mailing list
> [email protected]
> https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
> This list provided by the League of Professional System Administrators
> http://lopsa.org/
>
>
>
> _______________________________________________
> Tech mailing list
> [email protected]
> https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
> This list provided by the League of Professional System Administrators
>  http://lopsa.org/
>



-- 
LITTLE GIRL: But which cookie will you eat FIRST?
COOKIE MONSTER: Me think you have misconception of cookie-eating process.
_______________________________________________
Tech mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to