で小さなバックアップ スクリプトを作成しましたrsync
。ソース ディレクトリと宛先ディレクトリの合計ファイル サイズを比較して、進行状況を監視したいと考えています。 は、du
ファイル サイズではなくディスク使用量を測定し、ディスク使用量はファイル システムによって異なるため、不正確です。
ディレクトリ構造全体のファイル サイズを要約するにはどうすればよいですか?
答え1
おそらく、--apparent-size
次のオプションがdu
あなたが求めているものを実現するでしょう:
--apparent-size
print apparent sizes, rather than disk usage; although the
apparent size is usually smaller, it may be larger due to holes
in (`sparse') files, internal fragmentation, indirect blocks,
and the like
これにより、ファイル システムのブロック サイズやその他のメタデータへの依存がなくなるはずです。