[編集:
私の質問に答えます。
使用 と 一部 の ハッキングunison
後処理
((まだ災害復旧処理することが多いので、終わったと思います。)これ現在...))
]
そのため、別のコンピュータにあったSSDがあり、
それを小さなSATA-USBエンクロージャ/アダプタエンクロージャの1つに挿入して
外部データドライブとしてマウントし、ブートパーティションをこのコンピュータAディレクトリにコピーするために
使用しました。rsync -aAX
バックアップのためにサーバーに
しかし、別の事件が起こった後おそらく元のブートパーティションの内容を変更せずに
2番目のバックアップを作成しました。
このコンピュータには2つのディレクトリがあります
。おそらくまったく同じバックアップのコピーが2つ
ありますが、確認したかったです。
だから私の質問は次のようになります
この2つの大規模バックアップディレクトリを比較/区別する最良の方法は何ですか?
検討/試行したが問題があるかどうかわからないことの概要:
diff
それ自体rsync
「空の状態で実行」技術unison
[(考えてみましたが、バックアップが大きすぎて既存のハードウェアが遅いため実行していません。)]
これらの1つは本質的に良い選択ですか?
それでは、どのように使用するのか詳細に修正がありますか?
それとも私が知る必要がある別の追加オプションがありますか?
私の試みと結果/問題の詳細:
diff
これを行うための確実な方法は」ノーマル
「ディレクトリは次のよう
にdiff -r dir_A dir_B
なり
ます 。diff -r --no-dereference dir_A dir_B
--no-dereference
漠然と過去にも同様の状況がありました。
)
しかし、それを使用する際の問題は、diff
これらのディレクトリがもちろん非常に大きくて
ブート可能なシステムの「奇妙な」ファイル
(「文字特殊ファイル」や「ブロック特殊ファイル」など)でいっぱいになっていることです。
rsync
rsync
そこで、その間に再度使用して、
変更が報告されたことを確認するために「テスト実行」を実行することを考えました。
いいね:
$sudo rsyncy -n -aAX dir_A dir_B --log-file=log_file
ところが突然そんな気がした。
- 「あるならどうしよう?新しいファイルはdir_Bにありますか? 」
- 「rsyncyはこれを報告する必要がありますか?」
したがって、$sudo rsyncy -n -aAX --delete dir_A dir_B --log-file='log_file[A-to-B]'
と
$の両方を確認する必要があるようです。sudo rsyncy -n -aAX --delete dir_B dir_A --log-file='log_file[B-to-A]'
少し不気味な感じがし始めます。結局のところ、これは仕事に適したツールではないかもしれません...?
私がログファイルから読んだ内容は次のとおりです。
A-to-B
#=>
2023/07/21 01:43:04 [26686] building file list
2023/07/21 02:12:24 [26686] sent 80.58M bytes received 292.46K bytes 45.93K bytes/sec
2023/07/21 02:12:24 [26686] total size is 229.29G speedup is 2,835.29 (DRY RUN)
B-to-A
2023/07/21 01:41:58 [26406] building file list
2023/07/21 02:12:15 [26406] sent 80.58M bytes received 292.50K bytes 44.49K bytes/sec
2023/07/21 02:12:15 [26406] total size is 229.29G speedup is 2,835.29 (DRY RUN)
面倒(タイムスタンプと速度情報を無視)ほぼ同じ:
両方
sent 80.58M bytes
しかし、非常に小さい受け取った違い:
received 292.46K bytes
対
received 292.50K bytes
はい、もう一度rsync
このヒントが実際に作業に適したツールなのかと思いますか?
たぶんそれは本当に正しい答えかもしれません。はい例:
「
忍耐を持ってdiff
2つの巨大なディレクトリを処理するのに長い時間がかかります。(などに関するすべてのエラーメッセージは
無視できます。)」special file
unison
[まだわからない? ]
答え1
unison
これはついに私のために働いた。
ここに一貫した出力データ
と最後にフィッシュシェルを使って行った手動チェックがあります。
一貫したデータ
$unison dir_A dir_B
unknown file type
起動可能なシステムで発生した奇妙なことがエラーとして報告されていますが、
要約すると次のようになります。
0 items will be synced, 326 skipped
0 B to be synced from dir_A to dir_B
0 B to be synced from dir_B to dir_A
No updates to propagate
Synchronization complete at 07:40:11 (0 items transferred, 326 skipped, 0 failed)
次に、同様のリスト
(
可変タブスペースの並べ替え、
並べ替え、およびStack Exchangeの制限(" ")
内に収まるように複数の重複行を削除します):Body is limited to 30000 characters; you entered 56882.
#
skipped: dev/console (path dir_A/dev/console has unknown file type)
skipped: dev/core (path dir_A/dev/core has unknown file type)
skipped: dev/full (path dir_A/dev/full has unknown file type)
skipped: dev/hda (path dir_A/dev/hda has unknown file type)
skipped: dev/hda1 (path dir_A/dev/hda1 has unknown file type)
skipped: dev/hda10 (path dir_A/dev/hda10 has unknown file type)
skipped: dev/hda11 (path dir_A/dev/hda11 has unknown file type)
skipped: dev/hda12 (path dir_A/dev/hda12 has unknown file type)
skipped: dev/hda13 (path dir_A/dev/hda13 has unknown file type)
skipped: dev/hda14 (path dir_A/dev/hda14 has unknown file type)
skipped: dev/hda15 (path dir_A/dev/hda15 has unknown file type)
skipped: dev/hda16 (path dir_A/dev/hda16 has unknown file type)
skipped: dev/hda17 (path dir_A/dev/hda17 has unknown file type)
skipped: dev/hda18 (path dir_A/dev/hda18 has unknown file type)
skipped: dev/hda19 (path dir_A/dev/hda19 has unknown file type)
skipped: dev/hda2 (path dir_A/dev/hda2 has unknown file type)
skipped: dev/input/event0 (path dir_A/dev/input/event0 has unknown file type)
skipped: dev/input/event1 (path dir_A/dev/input/event1 has unknown file type)
skipped: dev/input/event10 (path dir_A/dev/input/event10 has unknown file type)
skipped: dev/input/event11 (path dir_A/dev/input/event11 has unknown file type)
skipped: dev/input/event12 (path dir_A/dev/input/event12 has unknown file type)
skipped: dev/input/event13 (path dir_A/dev/input/event13 has unknown file type)
skipped: dev/input/event14 (path dir_A/dev/input/event14 has unknown file type)
skipped: dev/input/event15 (path dir_A/dev/input/event15 has unknown file type)
skipped: dev/input/event16 (path dir_A/dev/input/event16 has unknown file type)
skipped: dev/input/event17 (path dir_A/dev/input/event17 has unknown file type)
skipped: dev/input/event18 (path dir_A/dev/input/event18 has unknown file type)
skipped: dev/input/event19 (path dir_A/dev/input/event19 has unknown file type)
skipped: dev/input/js0 (path dir_A/dev/input/js0 has unknown file type)
skipped: dev/input/js1 (path dir_A/dev/input/js1 has unknown file type)
skipped: dev/input/js10 (path dir_A/dev/input/js10 has unknown file type)
skipped: dev/input/js11 (path dir_A/dev/input/js11 has unknown file type)
skipped: dev/input/js12 (path dir_A/dev/input/js12 has unknown file type)
skipped: dev/input/js13 (path dir_A/dev/input/js13 has unknown file type)
skipped: dev/input/js14 (path dir_A/dev/input/js14 has unknown file type)
skipped: dev/input/js15 (path dir_A/dev/input/js15 has unknown file type)
skipped: dev/input/js16 (path dir_A/dev/input/js16 has unknown file type)
skipped: dev/input/js17 (path dir_A/dev/input/js17 has unknown file type)
skipped: dev/input/js18 (path dir_A/dev/input/js18 has unknown file type)
skipped: dev/input/js19 (path dir_A/dev/input/js19 has unknown file type)
skipped: dev/input/keyboard (path dir_A/dev/input/keyboard has unknown file type)
skipped: dev/input/mice (path dir_A/dev/input/mice has unknown file type)
skipped: dev/input/mouse (path dir_A/dev/input/mouse has unknown file type)
skipped: dev/input/mouse0 (path dir_A/dev/input/mouse0 has unknown file type)
skipped: dev/input/mouse1 (path dir_A/dev/input/mouse1 has unknown file type)
skipped: dev/input/mouse10 (path dir_A/dev/input/mouse10 has unknown file type)
skipped: dev/input/mouse11 (path dir_A/dev/input/mouse11 has unknown file type)
skipped: dev/input/mouse12 (path dir_A/dev/input/mouse12 has unknown file type)
skipped: dev/input/mouse13 (path dir_A/dev/input/mouse13 has unknown file type)
skipped: dev/input/mouse14 (path dir_A/dev/input/mouse14 has unknown file type)
skipped: dev/input/mouse15 (path dir_A/dev/input/mouse15 has unknown file type)
skipped: dev/input/mouse16 (path dir_A/dev/input/mouse16 has unknown file type)
skipped: dev/input/mouse17 (path dir_A/dev/input/mouse17 has unknown file type)
skipped: dev/input/mouse18 (path dir_A/dev/input/mouse18 has unknown file type)
skipped: dev/input/mouse19 (path dir_A/dev/input/mouse19 has unknown file type)
skipped: dev/input/uinput (path dir_A/dev/input/uinput has unknown file type)
skipped: dev/mem (path dir_A/dev/mem has unknown file type)
skipped: dev/null (path dir_A/dev/null has unknown file type)
skipped: dev/port (path dir_A/dev/port has unknown file type)
skipped: dev/ptmx (path dir_A/dev/ptmx has unknown file type)
skipped: dev/random (path dir_A/dev/random has unknown file type)
skipped: dev/sda (path dir_A/dev/sda has unknown file type)
skipped: dev/sda1 (path dir_A/dev/sda1 has unknown file type)
skipped: dev/sda10 (path dir_A/dev/sda10 has unknown file type)
skipped: dev/sda11 (path dir_A/dev/sda11 has unknown file type)
skipped: dev/sda12 (path dir_A/dev/sda12 has unknown file type)
skipped: dev/sda13 (path dir_A/dev/sda13 has unknown file type)
skipped: dev/sda14 (path dir_A/dev/sda14 has unknown file type)
skipped: dev/sda15 (path dir_A/dev/sda15 has unknown file type)
skipped: dev/tty (path dir_A/dev/tty has unknown file type)
skipped: dev/tty0 (path dir_A/dev/tty0 has unknown file type)
skipped: dev/tty1 (path dir_A/dev/tty1 has unknown file type)
skipped: dev/tty10 (path dir_A/dev/tty10 has unknown file type)
skipped: dev/tty11 (path dir_A/dev/tty11 has unknown file type)
skipped: dev/tty12 (path dir_A/dev/tty12 has unknown file type)
skipped: dev/tty13 (path dir_A/dev/tty13 has unknown file type)
skipped: dev/tty14 (path dir_A/dev/tty14 has unknown file type)
skipped: dev/tty15 (path dir_A/dev/tty15 has unknown file type)
skipped: dev/tty16 (path dir_A/dev/tty16 has unknown file type)
skipped: dev/tty17 (path dir_A/dev/tty17 has unknown file type)
skipped: dev/tty18 (path dir_A/dev/tty18 has unknown file type)
skipped: dev/tty19 (path dir_A/dev/tty19 has unknown file type)
skipped: dev/urandom (path dir_A/dev/urandom has unknown file type)
skipped: dev/zero (path dir_A/dev/zero has unknown file type)
#
skipped: tmp/runtime-username/pulse/native (path dir_A/tmp/runtime-username/pulse/native has unknown file type)
skipped: var/guix/daemon-socket/socket (path dir_A/var/guix/daemon-socket/socket has unknown file type)
skipped: var/spool/postfix/private/anvil (path dir_A/var/spool/postfix/private/anvil has unknown file type)
skipped: var/spool/postfix/private/bounce (path dir_A/var/spool/postfix/private/bounce has unknown file type)
skipped: var/spool/postfix/private/defer (path dir_A/var/spool/postfix/private/defer has unknown file type)
skipped: var/spool/postfix/private/discard (path dir_A/var/spool/postfix/private/discard has unknown file type)
skipped: var/spool/postfix/private/error (path dir_A/var/spool/postfix/private/error has unknown file type)
skipped: var/spool/postfix/private/lmtp (path dir_A/var/spool/postfix/private/lmtp has unknown file type)
skipped: var/spool/postfix/private/local (path dir_A/var/spool/postfix/private/local has unknown file type)
skipped: var/spool/postfix/private/proxymap (path dir_A/var/spool/postfix/private/proxymap has unknown file type)
skipped: var/spool/postfix/private/proxywrite (path dir_A/var/spool/postfix/private/proxywrite has unknown file type)
skipped: var/spool/postfix/private/relay (path dir_A/var/spool/postfix/private/relay has unknown file type)
skipped: var/spool/postfix/private/retry (path dir_A/var/spool/postfix/private/retry has unknown file type)
skipped: var/spool/postfix/private/rewrite (path dir_A/var/spool/postfix/private/rewrite has unknown file type)
skipped: var/spool/postfix/private/scache (path dir_A/var/spool/postfix/private/scache has unknown file type)
skipped: var/spool/postfix/private/smtp (path dir_A/var/spool/postfix/private/smtp has unknown file type)
skipped: var/spool/postfix/private/tlsmgr (path dir_A/var/spool/postfix/private/tlsmgr has unknown file type)
skipped: var/spool/postfix/private/trace (path dir_A/var/spool/postfix/private/trace has unknown file type)
skipped: var/spool/postfix/private/verify (path dir_A/var/spool/postfix/private/verify has unknown file type)
skipped: var/spool/postfix/private/virtual (path dir_A/var/spool/postfix/private/virtual has unknown file type)
skipped: var/spool/postfix/public/cleanup (path dir_A/var/spool/postfix/public/cleanup has unknown file type)
skipped: var/spool/postfix/public/flush (path dir_A/var/spool/postfix/public/flush has unknown file type)
skipped: var/spool/postfix/public/pickup (path dir_A/var/spool/postfix/public/pickup has unknown file type)
skipped: var/spool/postfix/public/postlog (path dir_A/var/spool/postfix/public/postlog has unknown file type)
skipped: var/spool/postfix/public/qmgr (path dir_A/var/spool/postfix/public/qmgr has unknown file type)
skipped: var/spool/postfix/public/showq (path dir_A/var/spool/postfix/public/showq has unknown file type)
skipped: var/tmp/audacity-username/.audacity.sock (path dir_A/var/tmp/audacity-username/.audacity.sock has unknown file type)
家の下にいくつかの項目を追加してください。たとえば、次のようになります。
#
#
#
skipped: home/username/.cache/fontforge/python-socket (path dir_A/home/username/.cache/fontforge/python-socket has unknown file type)
skipped: home/username/.cache/keyring-70EDPZ/control (path dir_A/home/username/.cache/keyring-70EDPZ/control has unknown file type)
#
skipped: home/username/.copy/copyagent-overlay.socket (path dir_A/home/username/.copy/copyagent-overlay.socket has unknown file type)
#
skipped: home/username/.dropbox/command_socket (path dir_A/home/username/.dropbox/command_socket has unknown file type)
skipped: home/username/.dropbox/iface_socket (path dir_A/home/username/.dropbox/iface_socket has unknown file type)
#
#
skipped: home/username/.local/share/parcellite/fifo_c (path dir_A/home/username/.local/share/parcellite/fifo_c has unknown file type)
skipped: home/username/.local/share/parcellite/fifo_cmd (path dir_A/home/username/.local/share/parcellite/fifo_cmd has unknown file type)
skipped: home/username/.local/share/parcellite/fifo_p (path dir_A/home/username/.local/share/parcellite/fifo_p has unknown file type)
#
skipped: home/username/.steam/steam.pipe (path dir_A/home/username/.steam/steam.pipe has unknown file type)
#
skipped: home/username/Dropbox/.emacs.d/packages/gnupg/S.gpg-agent (path dir_A/home/username/Dropbox/.emacs.d/packages/gnupg/S.gpg-agent has unknown file type)
#
skipped: home/username/ax/bups/hostname/dropbox/0rolling/Dropbox/.emacs.d/packages/gnupg/S.gpg-agent (path dir_A/home/username/ax/bups/hostname/dropbox/0rolling/Dropbox/.emacs.d/packages/gnupg/S.gpg-agent has unknown file type)
fishshellを使って手動で確認しました。
テキストエディタで複数選択を使用して、次のビットを抽出します。
" (path [this bit] has unknown file type)
"(パス内のすべての文字を
エスケープする必要があります)次のように繰り返すことができます(andを含むディレクトリから)。'
dir_A
dir_B
# personal functions used
# bbl
function bbl --description 'big block lines'
set -l bb $argv
if test "$bb"
for l in (string trim $bb)
string trim $l
end
else
while read -l l
set l (string trim $l)
test "$l"
and echo $l
end
end
end
# p (pretty print feedback thing)
function p
if test -n "$argv"
echo -n (set color $fish_color_comment) '#$ ' (set_color normal)
string escape --style script -- $argv |string join " " | fish_indent --ansi -i
else
while read -l x
echo -n (set color $fish_color_comment) '#$ ' (set_color normal)
string escape --style script -- $x |string join " " | fish_indent --ansi -i
end
end
end
# actually doing it
for path in (
bbl '
dir_A/dev/console
dir_A/dev/core
dir_A/dev/full
dir_A/dev/hda
dir_A/dev/hda1
dir_A/dev/hda10
dir_A/dev/hda11
dir_A/dev/hda12
dir_A/dev/hda13
dir_A/dev/hda14
dir_A/dev/hda15
dir_A/dev/hda16
dir_A/dev/hda17
dir_A/dev/hda18
dir_A/dev/hda19
dir_A/dev/hda2
dir_A/dev/input/event0
dir_A/dev/input/event1
dir_A/dev/input/event10
dir_A/dev/input/event11
dir_A/dev/input/event12
dir_A/dev/input/event13
dir_A/dev/input/event14
dir_A/dev/input/event15
dir_A/dev/input/event16
dir_A/dev/input/event17
dir_A/dev/input/event18
dir_A/dev/input/event19
dir_A/dev/input/js0
dir_A/dev/input/js1
dir_A/dev/input/js10
dir_A/dev/input/js11
dir_A/dev/input/js12
dir_A/dev/input/js13
dir_A/dev/input/js14
dir_A/dev/input/js15
dir_A/dev/input/js16
dir_A/dev/input/js17
dir_A/dev/input/js18
dir_A/dev/input/js19
dir_A/dev/input/keyboard
dir_A/dev/input/mice
dir_A/dev/input/mouse
dir_A/dev/input/mouse0
dir_A/dev/input/mouse1
dir_A/dev/input/mouse10
dir_A/dev/input/mouse11
dir_A/dev/input/mouse12
dir_A/dev/input/mouse13
dir_A/dev/input/mouse14
dir_A/dev/input/mouse15
dir_A/dev/input/mouse16
dir_A/dev/input/mouse17
dir_A/dev/input/mouse18
dir_A/dev/input/mouse19
dir_A/dev/input/uinput
dir_A/dev/mem
dir_A/dev/null
dir_A/dev/port
dir_A/dev/ptmx
dir_A/dev/random
dir_A/dev/sda
dir_A/dev/sda1
dir_A/dev/sda10
dir_A/dev/sda11
dir_A/dev/sda12
dir_A/dev/sda13
dir_A/dev/sda14
dir_A/dev/sda15
dir_A/dev/tty
dir_A/dev/tty0
dir_A/dev/tty1
dir_A/dev/tty10
dir_A/dev/tty11
dir_A/dev/tty12
dir_A/dev/tty13
dir_A/dev/tty14
dir_A/dev/tty15
dir_A/dev/tty16
dir_A/dev/tty17
dir_A/dev/tty18
dir_A/dev/tty19
dir_A/dev/urandom
dir_A/dev/zero
dir_A/tmp/runtime-username/pulse/native
dir_A/var/guix/daemon-socket/socket
dir_A/var/spool/postfix/private/anvil
dir_A/var/spool/postfix/private/bounce
dir_A/var/spool/postfix/private/defer
dir_A/var/spool/postfix/private/discard
dir_A/var/spool/postfix/private/error
dir_A/var/spool/postfix/private/lmtp
dir_A/var/spool/postfix/private/local
dir_A/var/spool/postfix/private/proxymap
dir_A/var/spool/postfix/private/proxywrite
dir_A/var/spool/postfix/private/relay
dir_A/var/spool/postfix/private/retry
dir_A/var/spool/postfix/private/rewrite
dir_A/var/spool/postfix/private/scache
dir_A/var/spool/postfix/private/smtp
dir_A/var/spool/postfix/private/tlsmgr
dir_A/var/spool/postfix/private/trace
dir_A/var/spool/postfix/private/verify
dir_A/var/spool/postfix/private/virtual
dir_A/var/spool/postfix/public/cleanup
dir_A/var/spool/postfix/public/flush
dir_A/var/spool/postfix/public/pickup
dir_A/var/spool/postfix/public/postlog
dir_A/var/spool/postfix/public/qmgr
dir_A/var/spool/postfix/public/showq
dir_A/var/tmp/audacity-username/.audacity.sock
dir_A/home/username/.cache/fontforge/python-socket
dir_A/home/username/.cache/keyring-70EDPZ/control
dir_A/home/username/.copy/copyagent-overlay.socket
dir_A/home/username/.dropbox/command_socket
dir_A/home/username/.dropbox/iface_socket
dir_A/home/username/.local/share/parcellite/fifo_c
dir_A/home/username/.local/share/parcellite/fifo_cmd
dir_A/home/username/.local/share/parcellite/fifo_p
dir_A/home/username/.steam/steam.pipe
dir_A/home/username/Dropbox/.emacs.d/packages/gnupg/S.gpg-agent
dir_A/home/username/ax/bups/hostname/dropbox/0rolling/Dropbox/.emacs.d/packages/gnupg/S.gpg-agent
'
)
#
set -l path_A .dir_A/$path
set -l path_B .dir_B/$path
# `sudo diff` doesn't work for some reason (permission still denied even with sudo). I guess a weird edgecase bug in diff.
# p sudo diff $path_A $path_B
# sudo diff $path_A $path_B
# or breakpoint
#
for x in $path_A $path_B
p sudo test -e $x
sudo test -e $x
or breakpoint
set -l size (sudo stat -c %s $x) # sudo prolly not needed?
p test $size = "0"
test $size = "0"
or breakpoint
end
end
だから私の2つのバックアップはdir_A
実際にはdir_B
同じです。
(これらの奇妙なファイルがすべて本物かどうか後で確認します。はいソースソースのサイズは0です。 )
((まだ災害復旧処理することが多いので、終わったと思います。)これ現在...))