From nobody Thu May 4 15:53:10 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QByym044Jz49FYL for ; Thu, 4 May 2023 15:53:20 +0000 (UTC) (envelope-from kayasaman@optiplex-networks.com) Received: from mail.optiplex-networks.com (mail.optiplex-networks.com [212.159.80.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QByyk4NsHz3jlH for ; Thu, 4 May 2023 15:53:18 +0000 (UTC) (envelope-from kayasaman@optiplex-networks.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=optiplex-networks.com header.s=AE93A2AC-7F67-11EA-90AE-8A1FE64F6997 header.b=ETeSf4RX; spf=pass (mx1.freebsd.org: domain of kayasaman@optiplex-networks.com designates 212.159.80.20 as permitted sender) smtp.mailfrom=kayasaman@optiplex-networks.com Received: from localhost (localhost [127.0.0.1]) by mail.optiplex-networks.com (Postfix) with ESMTP id 3B39115C2C76 for ; Thu, 4 May 2023 16:53:11 +0100 (BST) Received: from mail.optiplex-networks.com ([127.0.0.1]) by localhost (mail.optiplex-networks.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iHOx6WijzeIc for ; Thu, 4 May 2023 16:53:11 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by mail.optiplex-networks.com (Postfix) with ESMTP id E674C15C2DBC for ; Thu, 4 May 2023 16:53:10 +0100 (BST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.optiplex-networks.com E674C15C2DBC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=optiplex-networks.com; s=AE93A2AC-7F67-11EA-90AE-8A1FE64F6997; t=1683215590; bh=NYe9uggLwTjaG3OS97XWNOeZeXdMFlc+yMq8dzqbnR4=; h=Message-ID:Date:MIME-Version:To:From; b=ETeSf4RXiQYQI+rhkB29NJuZMjopHdfVDfsoG8OBJJlf+snmYsRIv4jk31d83FOSh 0vIJRgcMmYBb+zZ2xPBoTB9flZ3SPaIyTuOqWyjiG1mUYH9OWWBrCSVGds/7+Rlg0f a69yIUDoA/I7hphUB0/yvtqyJ8ST1NuJEOwdaIUfhagL58+ElFgWqFTc1zmrowMHJL PIWP7ydRDiFD+k6IcgKOY8XIMqG6FSt9jcXTYoxFMp9ena6LPcCn1iOehAkEMKFQZC XSnqZey/XmFNnIbVOfaPhKWl34P+A4aIcrsS6ugzG8m8cVCCFxBqcMg7NN2lzOKRFb KxqsfLo/RS5aQ== X-Virus-Scanned: amavisd-new at mail.optiplex-networks.com Received: from mail.optiplex-networks.com ([127.0.0.1]) by localhost (mail.optiplex-networks.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id warWBsbKvMUC for ; Thu, 4 May 2023 16:53:10 +0100 (BST) Received: from [192.168.20.23] (unknown [192.168.20.23]) by mail.optiplex-networks.com (Postfix) with ESMTPSA id D1DE515C2C76 for ; Thu, 4 May 2023 16:53:10 +0100 (BST) Message-ID: <9887a438-95e7-87cc-a162-4ad7a70d744f@optiplex-networks.com> Date: Thu, 4 May 2023 16:53:10 +0100 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: freebsd-questions@freebsd.org From: Kaya Saman Subject: Tool to compare directories and delete duplicate files from one directory Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4QByyk4NsHz3jlH X-Spamd-Bar: / X-Spamd-Result: default: False [-0.50 / 15.00]; R_DKIM_ALLOW(-0.20)[optiplex-networks.com:s=AE93A2AC-7F67-11EA-90AE-8A1FE64F6997]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; DKIM_TRACE(0.00)[optiplex-networks.com:+]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; ASN(0.00)[asn:6871, ipnet:212.159.64.0/18, country:GB]; FROM_HAS_DN(0.00)[]; local_wl_ip(0.00)[212.159.80.20] X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: local_wl_ip X-ThisMailContainsUnwantedMimeParts: N Hi, I'm wondering if anyone knows of a tool like diff or so that can also delete files based on name and size from either left/right or source/destination directory? Basically what I have done is performed an rsync without using the --remove-source-files option onto a newly bought and created disk pool (yes zpool) that i am trying to consolidate my data - as it's currently spread out over multiple pools with the same folder name. The issue I am facing mainly is that I perform another rsync and use the --remove-source-files option, rsync will delete files based on name while there are some files that have the same name but not same size and I would like to retain these files. Right now I have looked at many different options in both rsync and other tools but found nothing suitable. I even tested using a few test dirs and files that I put into /tmp and whatever I tried, the files of different size either got transferred or deleted. How would be a good way to approach this problem? Even if I create some kind of shell script and use diff, I think it will only compare names and not file sizes. I'm really lost here.... Regards, Kaya