[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to compare contents of two folders against third one?



On 01.11.2023 22:55, tomas@tuxteam.de wrote:
I concur with Nicolas: every time you say "folder", a unicorn dies.

If I say tater instead of potato would it also make you sad?
Sorry to break it to you, but unicorns were extinct a long time ago, along with BBS', modems, MSDOS, ISA-VLB slots, jumpers and through-hole ICs.
Only BGAs, UEFI, liquid metal, Bluetooth and other planned obsolescence garbage remains.

You mean: the union of dest-dir-1 and dest-dir-2 should equal your
source-dir?

  Try rsync -a source-dir/ dest-dir-2/ --compare-dest=dest-dir-1/

This one will even dutifully copy those files from source-dir which
can't be found either in dest-dir-1 or in dest-dir-2.

If you only want to /see/ what would be copied (always a good idea
when trying untested advice from random folks on the internets :)
there's the option --dry-run. Perhaps add the option -v.

Rsync is magic.

Cheers
Rsync wasn't helpful in my case. It refused to recognize file names properly, complaining about charset encoding, not even with --iconv parameters.
Probably because of locale differences between my system and mounted filesystems and who knows what else.

--
With kindest regards, Alexander.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀

Reply to: