How to display progress bar for tar incremental archives

tar

While creating a level-0 archive I can do this:

 tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > out.tgz

But in case of a level-1 (incremental) archive, I don't know beforehand what the size of data to be archived will be.
So I can't give that value to pv with the -s parameter (or have any idea about how long it'll take).

What can be done?

Best Answer

Assuming you perform your incremental archives by tarring the directory and running the output through a filter that returns the difference between this and your existing archives, your current progress calculation could be fine in this case. Why? Because progress is determined by how much of the directory has tar read so far.

Now then, this is just a supposition. Care to share the command you use to make an incremental archive?

Related Question