From nobody Thu May 04 16:29:22 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 4QBzmb307Vz49HDc for ; Thu, 4 May 2023 16:29:35 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QBzmZ5fM6z3sX2 for ; Thu, 4 May 2023 16:29:34 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-38de3338abeso391728b6e.1 for ; Thu, 04 May 2023 09:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683217773; x=1685809773; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EFw5JAZFa01OaxYiC/pMePCPidlImHyAPgV3nPljf8k=; b=IcNEm+q8TMAkAyeSJU+Df5rPHcD6df8+EkgszgTZ65/VnsrOGtQtmrj753rImNWr0+ aRmET0n0EveSea1hveEVcGfRr9eWAtCU+/SYZs1KRvbZ/pSLQLyTt5WW4DH3MupX4sTw x8ibgyF/CxaKXvSQF3/Bnf+DU7xRorBorpYtWAELu0/zvk4UXF5nPxM+o2Hhm2Sao02Z jnZFT0g4bm8+f0K/WmACVsSG0nxouaCcnYE9JOlPyeg5gZs5GPejMUTvCvfi7vkoAjHB xjIOd4fcGz6/OpS2wH+JWc/WJUFteZq4q+thHhNPLqD8h1TrlJay39y4Lxt9EU22Aigd GYcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683217774; x=1685809774; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EFw5JAZFa01OaxYiC/pMePCPidlImHyAPgV3nPljf8k=; b=i64CSnUjoCEe8qepQwXfr7wcpeB1eF0jdSzpXwT5olp2iw42Y+2qiROs3EaNu5qlh8 9fiXG8dRsvkiqFCxwVrVioBSIBjaoojgPI41j1v0h++h7wK9oSZAZovm6gca2vyL0D88 02wUj/QLCvnVTxLdh777LjLVYryUX8t63OChYg3lG82o8i77gwyKueImWlnQBmxB+XQc r3sKhe5YholFKOzk32n/FffeS7DDYaHByoICsumSwTk/YbO53BXQCOoaA21mzC6UPSDu l9mMGnYSj9TADBxTplk+JNTW9FY5hb34JOVAeljU/U6IyGiVLtfOtWJqrnD9+5+mwZgl 8P/A== X-Gm-Message-State: AC+VfDwtZec8Udr/6JI6Np1zdZSfq32vPouukbKMmiWeUnDQF5FDMCxA XZk9bjaPtPPZDMJQAcb7OTjPNL0DjX5R9675qYp8ikiJB1vq X-Google-Smtp-Source: ACHHUZ6dSuFD0L07FkTopZgnRYhh6Vg1ZXpFKuqOHsjH0Ebo2NZPtXv4OcII7nUC0B2zzM3JlLAEvuWl6PiX9ld1h0Q= X-Received: by 2002:aca:a80e:0:b0:38b:c4c3:b3ec with SMTP id r14-20020acaa80e000000b0038bc4c3b3ecmr1921277oie.3.1683217773737; Thu, 04 May 2023 09:29:33 -0700 (PDT) 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 References: <9887a438-95e7-87cc-a162-4ad7a70d744f@optiplex-networks.com> In-Reply-To: <9887a438-95e7-87cc-a162-4ad7a70d744f@optiplex-networks.com> From: Paul Procacci Date: Thu, 4 May 2023 12:29:22 -0400 Message-ID: Subject: Re: Tool to compare directories and delete duplicate files from one directory To: Kaya Saman Cc: freebsd-questions@freebsd.org Content-Type: multipart/alternative; boundary="0000000000007bbd5905fae0adda" X-Rspamd-Queue-Id: 4QBzmZ5fM6z3sX2 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000007bbd5905fae0adda Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 4, 2023 at 11:53=E2=80=AFAM Kaya Saman wrote: > 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 > > > > It sounds like you want fdupes. It's in the ports tree. ~Paul --=20 __________________ :(){ :|:& };: --0000000000007bbd5905fae0adda Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, May 4, 2023 at 11:53=E2= =80=AFAM Kaya Saman <= kayasaman@optiplex-networks.com> wrote:
Hi,


I'm wondering if anyone knows of a tool like diff or so that can also <= br> 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




It sounds like you want fdupes.=C2=A0 It&= #39;s in the ports tree.

~Paul

<= span class=3D"gmail_signature_prefix">--
__________________

:(){ :|:& };:
--0000000000007bbd5905fae0adda--