rsync calculating the number of files transferred

jw schultz jw at pegasys.ws
Thu Apr 17 10:00:40 EST 2003


On Wed, Apr 16, 2003 at 04:34:00PM -0700, Eric Chen wrote:
> Hi,
> 
> Is there anyway that rsync can report how many files it has to transfer? I
> am using rsync in a backup utility, and I want to display the percentage
> completion. If I can find out the number of files it has to transfer, I
> should be able to compute the percentage by just dividing that by the number
> of files already transferred.
> 
> Maybe I am approaching this whole thing wrong. Does anybody have any
> suggestions on what I can do to display the percentage completion?
> 
> Please reply to eric at primes.com because I am not on the list.

Rsync doesn't know in advance the number of files it will
transfer.  It creates a file list of all files to be
examined and then works through the list skipping or
processing files as it evaluates the need.  The closest you
could get to knowing the number of files to be transfered
would be to run rsync --dry-run first which will double the
runtime for static trees.

For the most part i'd suggest that if your backup jobs take
so long that it is worthwhile calculating a percentage
completion it would be desireable to split them up.  Backups
should not require live monitoring.

-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt


More information about the rsync mailing list