[편집:
내 질문에 답합니다.
사용 unison
및 일부 해킹된 후처리
(
unison의 로그 출력을 복사하여 붙여넣고
텍스트 편집기에서 다중 선택 편집을 통해 조정한 다음
이에 대해 일부 쉘 스크립팅 수행(fishshell)
)
((아직 재해복구 처리할 일이 많아서 다 끝난 것 같아요.이것현재...))
]
그래서 다른 컴퓨터에 있던 SSD가 있고
이를 작은 SATA-USB 인클로저/어댑터 인클로저 중 하나에 넣고
외부 데이터 드라이브로 마운트한 다음 부팅 파티션을 이 컴퓨터 A 디렉터리에 복사하는 데
사용했습니다. rsync -aAX
백업을 위해 서버에
그런데 또 다른 사건이 일어난 후아마도원래 부팅 파티션의 내용을 변경하지 않고
두 번째 백업을 만들었습니다.
이제 이 컴퓨터에는 두 개의 디렉터리가 있습니다
.아마도정확히 동일한 백업의 복사본이 두 개
있지만 확인하고 싶었습니다.
그래서 내 질문은 다음과 같습니다
이 두 개의 대규모 백업 디렉터리를 비교/구별하는 가장 좋은 방법은 무엇입니까?
고려/시도했지만 문제가 있거나 확실하지 않은 사항 요약:
diff
그 자체rsync
"빈 상태에서 실행" 기술unison
[(생각해봤는데 백업이 너무 크고 기존 하드웨어가 느리기 때문에 실행해본 적이 없습니다.)]
이들 중 하나가 본질적으로 좋은 선택입니까?
그렇다면 어떻게 사용해야 하는지 세부 사항에 수정 사항이 있나요?
아니면 제가 알아야 할 별도의 추가 옵션이 있나요?
내 시도 및 결과/문제에 대한 세부 정보:
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
두 개의 거대한 디렉토리를 처리하는 데 오랜 시간이 걸리도록 하십시오. ( 등에 대한 모든 오류 메시지는
무시할 수 있습니다 .) " ?special file
unison
[아직 잘 모르겠어? ]
답변1
unison
이것은 마침내 나를 위해 일했습니다.
여기에 일관된 출력 데이터
와 마지막에 fish shell을 사용하여 수행한 수동 검사가 있습니다.
일관된 데이터
$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
그래서 내 두 백업은 dir_A
실제로 dir_B
동일합니다.
(이 이상한 파일들이 모두 진짜인지 나중에 확인하겠습니다.예원본 소스의 크기는 0입니다. )
((아직 재해복구 처리할 일이 많아서 다 끝난 것 같아요.이것현재...))