简体   繁体   English

根据目录确定.tar.gz文件大小

[英]Determine .tar.gz filesize based on directory

I am not sure if this is possible, but I assume it is; 我不确定是否可行,但我认为是可行的。 I need to find out how big a gzipped tar file might be if I tarred up a specific directory. 我需要找出一个特定目录的tar压缩文件的大小。 I simply want progress numbers while a long tar creation is running. 我只是想在运行长时间的tar时获取进度编号。

If I knew how big the tar file would be once completed, I could make my own progress numbers. 如果我知道tar文件一旦完成将有多大,我可以自己制定进度号。 I am aware of tar file progress bars, but these are interactive, and I simply want to check back from time to time to see the current percentage; 我知道tar文件进度条,但是它们是交互式的,我只想不时检查一下以查看当前百分比; any ideas? 有任何想法吗?

You can't know this for certain ahead of time. 您可能无法提前知道这一点。 The best you can do is calibrate your progress bar either on the number of source files or on the number of source bytes, then advance it as compression proceeds. 最好的办法是根据源文件数或源字节数校准进度条,然后随着压缩的进行进行调整。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM