13

We know that if we give --progress parameter to rsync it will show the progress of files copied. But issue is that is shows the progress for each single file not total or overall progress.

So how to see the Total progress of files copied.

1

3 Answers 3

27

To see total progress with rsync, the modern versions (from 3.1.0) has option --info=progress2. rsync must be running on the same machine as source files (or with NFS) for this to show sane values. Don't forget to supply -a option too if you copy system directories.

4
  • 1
    Is it possible to have total and per-file simultaneously?
    – Tom Hale
    Commented Sep 12, 2019 at 15:24
  • Is it possible to have total only, without per-file?
    – Russ
    Commented Jan 18, 2020 at 13:39
  • actually, i just tried it and it seems that the values look sane even if I'm pulling files down from my server, i.e. running on a machine that's not the one with the source files.
    – Boson Bear
    Commented Jan 6, 2021 at 18:59
  • for recursive operations (e.g. with -a or -r), the total progress can be misleading in rsync 3, as all nested files and subdirectories will only be discovered lazily/ad-hoc/during command execution. To get a complete estimate from the beginning, add the --no-inc-recursive option.
    – Abdull
    Commented Dec 22, 2023 at 14:26
4

As the comments say, the question has already been asked here.

So... short answer: you can't.

EDIT: you can now use the --info=progress2 option of rsync to get an idea of overall progress (read the rest of my original answer if you are looking for an alternate progress indicator or for more info).

I'm quoting David Mackintosh:

There are no trivial ways to add a total progress indicator.

The reason for this is that when rsync looks at a list of files to sync, it doesn't know ahead of time which files will need to change. If you are doing delta transfers, the deltas themselves have to be calculated ahead of time to give a total picture of the work that needs to be done.

In other words, the easiest way to calculate how much work there is to be done is to actually do it.


But you can have a progress bar about the number of file transferred using pv, if you already know how much you have, quoting zerodeux:

rsync -aix /source remote:/dest | pv -les $(df -i /source | perl -ane 'print $F[2] if $F[5] =~ m:^/:') >/dev/null
2
  • 4
    There is a flaw in reasoning. Nobody is really upset if progress indicator runs faster than it promised. Rsync can assume that it will have to transfer all source file and then, if it finds some to be transferrred, simply count it as a speed increase. It is actually realised in modern rsync versions as a --info=progress2 option Commented Oct 15, 2014 at 10:24
  • @BarafuAlbino I didn't try that option, but it is common with rsync to have a speed increase factor > 200, which means that your progress indicator would go hundreds of times faster than expected, that is completely wrong... Except for saying that "60% of your files have been synchronized".
    – Totor
    Commented Oct 27, 2014 at 16:13
4

rsyncy is a rsync wrapper that shows a status bar with progress:

rsyncy

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .