Stdin Size - feature request

I had an idea, based off of pv - I’d like to request an --stdin-size switch where you could tell Restic the size of the incoming pipe and allow it to give you a fancy little ETA like it normally does. :slight_smile:

Hm, how would that work? If you pipe data from something’s stdout into restic’s stdin, then how would you already know the size of the data and thereby be able to hand it to restic in an option like the one you suggest?

If you don’t pipe output to input and instead have the data in some file or whatever, you’d just run restic as usual and thereby get the ETA like normal.

With pv you, as well, have to specify the amount of data to get useful ETA output.
If you don’t then it’s pretty much just a clock which eventually says 99% when it’s done :smiley:

Right, and my question still stands. How would this work in practice?

Well you already answered yourself as one couldn’t know the size beforehand… so ¯\_(ツ)_/¯
I don’t see a way you could but am open for any creative ideas lol

Haha, okay, thought I was missing something that I didn’t understand xD

Yes. I primarily use --stdin to pipe whole disk images - often SD cards or sometimes whole hard drives for data recovery purposes - so I know the exact size. Again I can just use pv -pears 16G | restic -q --stdin backup but if Restic had --stdin-size 16G as an option I could just use cat. But yes, the use cases would pretty much be identical to pv’s -s switch use cases. Just throwing it out there. No biggie if this falls under “feature bloat”. But I’d use it often, myself! ¯\_(ツ)_/¯

The reason I do this is so that I can still mount the .img file, yet have it compressed. If I pipe the .img to xz, I have to decompress in order to mount it. I’ve dabbled with SquashFS but that’s a pain. But restic mount is perfect for this. :slight_smile: