dump でバックアップ restore で復元

dump, restore

Mac OS X は Time Machine で超簡単ど素人でも簡単に完全にすべてをバックアップできます。

ここでは Linux で自分が使うのを目的として UNIX の伝統的な dump, restore によるバックアップをメモります。

/dev/sdb1 を filename というファイルに丸ごとバックアップするとき

dump -0uf filename /dev/sdb1

0 がレベル。 0やったあとは 1 にするとインクリメンタル。以後 9 までインクリメンタルに差分バックアップできる。

restore で戻すときはその逆をたどる。

それから数が前回より小さいものを使うと、戻った数までは無効でそっからの差分となる。

適当に時間がたったらレベル0のバックアップをしよう。

除外することもできる

chattr -R +d /home/suteaccount

除外されたか確認

lsattr /home/suteaccount

restoreで一部のファイルだけ取り出す

直接

restore -xf dumpfile ./toridashitai-file-no-path

対話的

restore -if dumpfile
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume # (none if no more volumes):

と言われたらおもむろに 1

set owner/mode for '.'? [yn]

と言われたらおもむろに y (元のowner/modeにセットする)

更新日時:2010/11/18 23:15:49
キーワード:
参照: