Assuming you use rsync with an SSH remote shell (and not - for example - with an rsync server), then you can get rsync to run SSH in a way that will never ask for a password. For example, once can use this call:
rsync -e 'ssh -o "NumberOfPasswordPrompts 0"' source user@target:/path
This will force rsync to use SSH with 0 possible password tries - if its can't gain access using some other authentication method (like public key or GSSAPI) then it will fail with an error. Do note that rsync will not like you when that happens and will complain loudly to STDERR and break with exit code 255.
rsync
is a powerful tool, but it is, unfortunately, strangely picky about some of its pathnames.
If $DATA
is an absolute path (i.e. it begins with a /
), then the correct command-line to use is:
rsync -a --link-dest=$DATA $DATA/ $DATA/../upgrade_tmp
[Now, just a brief aside about rsync
's strangeness. Note the trailing /
added to the source argument. This tells rsync
to work with the contents of the source directory, rather than with the source directory itself. (I'm assuming that $DATA
doesn't already contain a trailing /
.) In this case, we want to work with the contents, so we add the trailing /
.]
If, on the other hand, $DATA
is a relative path (i.e. it does not begin with a /
), then Sean R's comment about --link-dest
is bang on: The link-dest path is interpreted relative to the destination path, so you would use the following:
rsync -a --link-dest=../`basename $DATA` $DATA/ $DATA/../upgrade_tmp
EDIT
One final note, it turns out that the second rsync
command-line I gave should work regardless of whether $DATA
is an absolute path, since basename
doesn't care whether a path is absolute or relative.
Best Answer
Yes. Starting with rsync version 3.1.0 the
--info=progress2
argument will give you progress on the entire transfer, including speed of the entire transfer. You can see a little bit of detail on the rsync man page.