[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rsync



On Fri, Mar 02, 2012 at 10:33:56PM +0800, lina wrote:
> Hi,
> 
> Is it wrong when use
> 
> rsync -azvu source destination
> 
> sent 16 bytes  received 43 bytes  5.13 bytes/sec
> total size is 1507939808  speedup is 25558301.83
> 
> Destination $ du -sh md_0.xtc
> 342M	md_0.xtc
> 
> Source $ du -sh md_0.xtc
> 1.5G	md_0.xtc
> 
> my confusion is that
> why it stopped copy the rest.
> 
> Actually I got lots of questions but hesitated to ask, afraid of being
> told that those are in manuals. I have read several times but couldn't
> figure it out.
> 
> [1] suppose I use scp, due to the wireless is not stable, down, Can I
> continue transferring?
> 
> [2] When I ssh to a server, can I set up the terminal the same as when we
> open a tab in termial, it will be in that directory of the present
> tab's directory,
> can I open a tab in termial, with ssh connected, can it also in that
> server's directory, not home directory?
> 
If you really want the destination to be an exact copy of the source,
you probably don't want the -u in there.  Here's an example of why:

myvideo.avi on the source is 500MB, and is copied to the destination.
Later on, myvideo.avi on the destination is edited down to 100MB.  Next
time you rsync using -u, myvideo.avi will not transfer from the source
to the destination because the timestamp on the destination file is
later.

Now in the example I've given, it probably makes sense that you wouldn't
want your edited file to be overwritten by the original version of the
file.  So you might want to use the -u option.  But in this example that
would certainly result in the source and destination files being
different sizes.

Note that if you really, really want the destination to be an exact
duplicate of the source, you should also use the --delete option.  Just
be careful with that one!  It's always helpful to use --dry-run first so
that you don't get any surprises.

Regarding question [1], I think scp will do a full copy every time you
run it.  If you are concerned about an unstable network connection,
rsync is the way to go.

-Rob


Reply to: