0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

checksumchecksum

Posted at
/myfolderというフォルダをbackup.tar.gzにtarしたとするよ。


・まずtarが壊れていないかどうかの確認

tar -tzf backup.tar.gz > /dev/null

でエラーが表示されないかどうかを見る。


・元ファイルとtarしたファイルの全チェックサムを比較
これをやるには、tarを展開してみないと無理。

まずは元ファイルの全チェックサムを取得。

find /myfolder -type f -exec sha256sum {} \; | sort > original.sha256

tarを展開してから全チェックサムを取得。

mkdir /tmp/untar
tar -xvzf backup.tar.gz -C /tmp/untar
find /tmp/untar/myfolder -type f -exec sha256sum {} \; | sort > extracted.sha256

元ファイルとtarファイルのチェックサム比較。

diff original.sha256 extracted.sha256

という具合にやれば出来そうだけど、やる?
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?