A fixed-length progress bar, a file or byte count, or better yet a timer showing the estimated time remaining would be ideal.
zip
's standard behavior seems to be to print a line for every file processed, but I don't want that information overload when I zip thousands of files. I want a guesstimate how long it's going to take.
I tried the -q
(--quiet
) option in combination with -dg
(--display-globaldots
) but that just floods stdout with multiple lines of dots and gives no useful indication.
I also tried -qdgds 10m
as mentioned in the man page, but got the same result.
I then tried -db
(--display-bytes
) and -dc
(--display-counts
) but there doesn't seem to be a global option, so it again prints it for every filename.
Lastly, I tried it together with -q
like -qdbdc
, but that just outputs nothing.
Funnily enough, I found a man page on the info-zip site that mentions a -de
(--display-est-to-go
) option which should "Display an estimate of the time to finish the archiving operation."
That sounds exactly like what I want, but the problem is that my version of zip
does not have that feature. I'm using Ubuntu 14.04.1 64bit, bash-4.3.30(1) and zip-3.00. According to Wikipedia, this is zip's latest stable release.
There are unreleased beta versions on the info-zip sourceforge page, but I'd rather not entrust my data to a beta release.
tee
. Before starting zip, make a total count of the files (withls
orfind -type f
) and while it is zipping, read the log file for the number of lines of processed files it already has (withgrep
for the right lines to look at, andwc -l
for the lines count), so your high level info will show something like "234/76438 files processed";pv /path/to/file | gzip > /path/to/file.gz