From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9604C158095 for ; Fri, 2 Sep 2022 23:43:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 35CCBE0991; Fri, 2 Sep 2022 23:43:51 +0000 (UTC) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ECF65E03EC for ; Fri, 2 Sep 2022 23:43:50 +0000 (UTC) Received: by mail-qk1-x72b.google.com with SMTP id a15so2920177qko.4 for ; Fri, 02 Sep 2022 16:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject:from:to:cc :subject:date; bh=x8q8vbBV1B5vvzq2j7it2Si/bLjpqK6I3hqfXWp5m48=; b=Bp0C5y+qe3pjGztraI2GauW/f0y187ETpQj6yyhMu8zg6gXCx6ZutrX6vl7tjKKARy OlEOKXFI6LNoYolbJguD9wviPW06/0uJVBcSCvdx/B7D5bJuGMeR4dfOAiFUx3RTeqnF UH2ptDPLmAqKrQEbW6lQqfb1deDztDtCN8yTIs8UtkVNe66UJ/JKKD2LmnJ7vrvdCxnm px2XS+d8crEhV4PBYcxhDp/r+i3pliX2tU97AY3n+DYMyuUV77YbjWd5kIZPl80sZ3MO u1hKsbS6IKbNfaHY+mbZuHWTtBT7fLbojzKUbWWwUXyByuiUMRAgqMzUDmgDNielpIWr VY2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date; bh=x8q8vbBV1B5vvzq2j7it2Si/bLjpqK6I3hqfXWp5m48=; b=mbk+8uDQtnbrVzGCwuhOWRp/LKYyjAjiMG4KDTocd4wy1aw+tY0T945gUIjF6pL2l/ 3zoWFMcAv3v3JXHg65zO2gjb41WA/CjeFGJ3xs+BjCm/9JXl/6cnojX/GLH4Cw2RN/TQ v5tVZdP/lwc+0EsN29dshB69XtWcvolIU4dnkUs2B4wcqlbbCrwL09CHy4Lf6SzBoYQB cpz99cj6UZPiN4b4UP2KlQuW4hgnoFAJybpTdUg0s321Xi+oJ03Cht35DRlx2/alH1SR uostPY9NBILqaZHkAK1oi+x3McwfYPRp5p0ETIMEHRjr6p9fAxE8y890Mkq4+MRguATd brQQ== X-Gm-Message-State: ACgBeo25pRLdD+/DN06+2vIeBEyC43BkbSIfyQMHW6IYtwlthsXq+lvQ MUKeLMW3DQyyInWf0c9RafnwLCScghv2iw== X-Google-Smtp-Source: AA6agR61yoh4ekRDF4DSHf56HSLQBucNfXlM5/lXkPBhABvZqYXUBn7rkgSMAEp7NntdwkCuKvr+Lw== X-Received: by 2002:ae9:e402:0:b0:6a7:86a3:752e with SMTP id q2-20020ae9e402000000b006a786a3752emr24838117qkc.300.1662162229974; Fri, 02 Sep 2022 16:43:49 -0700 (PDT) Received: from [10.0.0.2] ([207.244.201.197]) by smtp.gmail.com with ESMTPSA id q11-20020a05620a0d8b00b006bbf85cad0fsm2520389qkl.20.2022.09.02.16.43.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Sep 2022 16:43:49 -0700 (PDT) Subject: Re: [gentoo-user] rsync not deleting removed directory and drive PW DIS 3.3v question To: gentoo-user@lists.gentoo.org References: <98d16301-9555-10de-6828-ceab211f6eed@gmail.com> From: Dale Openpgp: preference=signencrypt Autocrypt: addr=rdalek1967@gmail.com; prefer-encrypt=mutual; keydata= mQINBGFSciYBEADcEGMyJBSuavKO/XKUVvgkxck7Nl8Iuu8N2lcnRji/rSKg5c1Acix1ll9i oW8JBCHwvn0+Xy60BvEsqcup3YSHw5STl/bR1ePEehtnYrg8FdjdS91+B805RfnKMm69rFVI wLSBHQrSG1yxHd8CloWoEdhmVtP24buajbh114bgXd9ahtpZrCVMrWdWYUg2mEXguGV5uNAh Rf8SWxDNc79w24JxsV34a8niMUYMjzWr0rafIbzk732X38vGjVMLo/2mMpkbp9mPp++LHoY+ 0Pet8zxxdXPJSCd475kza1AD+hhSyBZXB9yknYWgyY3cZe1rGmooJSi2KX4QxO7npwLThcO1 be6KKRkd35+Fi/a1BzVOHsZMiK/gcwxEFoMd27gir4ehaeHJfFXl+65w4hj0EsOZSxrJrm2C R50g5By2czSKP1bADEygFNpIJj51AR+wM88NImG2RPtlT2maYBzazvF05g65cdHXGp1C7W5P wwwKU2DgABB2t7N7z5A69LnryBRw4zUYDRRYLTYlBlYgg+xILm2c0OrBdxJgLJa7JE50Eo25 d3PFwt9J0gYvqy6sPFLl9So0sDg9zm0hKQtXOP5kgropUFGrNoJI+mjwF4rYLRBVzZwNAvlO OhEvHubBo3mEllv4x+FeptwXZxlk7gUsdqI8AxnFB8K9wi6FVQARAQABtBtEYWxlIDxyZGFs ZWsxOTY3QGdtYWlsLmNvbT6JAk4EEwEIADgCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AW IQQSG1h01ruv/WNXc3Q3RqOgiQH1GwUCYVJy8gAKCRA3RqOgiQH1G+waEACeTZCt77jnRAmQ AV7otKuZekDWiLi3Eig8tj5ZJiCNSYA/hIxzmexRP0GMqjitcXK1iGwWcvMzzvIq30GAjIfB 4BR38cnXbtBa6fNewiT7QaZe/Hn6yBRldXNQypzbHy+/o27bU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pOVykNnqHTfFo3qFusHt0ZWgXVnnn4pYdXqZNoDhvF BRE5Vm4k/k96Pw8HRx6Os6eFSRrlqGzRgqsu86FekxusXB9UGv4lJhtU/J+8MRWsh22K718s DbQnABicGKFz1qQlWvcf59oTByhLINJCBt1WXl+TzJDXepr3QSkqmK41dO9Hob97C9dMiK8A EQEAAYkCNgQYAQgAIAIbDBYhBBIbWHTWu6/9Y1dzdDdGo6CJAfUbBQJhUnLyAAoJEDdGo6CJ AfUbVHIQAKSWw620vPhR3A/njU2z77F3z/Jk+HTKdE3fIyWSWdkYN7CBFL0NguOMP30WZ+qE sJhZu7T5hf251MwQUUt27xlfnKYOmQs7CqONlXuXlGZI6WufrUjxNcVz+5gJsqvUWuuJWsgg sDmE92IBnfG/f81fPHWQyfr/SF4wYDMyoFp5xCCQpp1zB63iuFvvrhxBkEHzmbRtVDOhl0Xp BVEDR1w3QRACw9QJD/KM05Czv9JNQYlwinWO/OaQ9cMlUpKLgswUPg9IZ5vucxScfuAUA5uC B1jlAQ8ZPlVukBmbEv5RGOv+lpuEbA3YDMVtEeH4YMFbjt/+vH3Cr2vTbp5JlpByLburJEH0 WXZLUawEfUsZvVwpOuJK75vaa2HYXee+Cb3iCIzwfIfctdlqzUcbGRczlRNM59hpvj4z29Gh 3kAxVHItAYq54ikxQ9l4hQ8s9sLYPbX/WtcBxNX8crBSw0FLnmzGleVEtBHyqtt5CLzQNgrj GYWl1vKDUmRPw1CdZ1c+fMN9CY11jOM5B5ZnqZWfDeVYO2iJ5SuvTycChexCb8WYn1bdCBIo bBtga2RBXbVt4Mh9E4owsszefn51MwfjXxB20Fc5k3GU1AVpTCMs3ayYCzo0b2pvEvdjtDcA CYLEFPWgaFX9iQAM/CDfKvTtvgGWpqtCL2raq/mQoJEU Message-ID: Date: Fri, 2 Sep 2022 18:43:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.13 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 43551fd4-5b14-4c66-822c-cd294272148a X-Archives-Hash: cf35ce6676b6790a6128be7734e4addf Sebastiaan L. Zoutendijk wrote: > Dear Dale, > > On Friday 2 September 2022, 3.35am -0500, Dale wrote: > >> time rsync -auv --progress --delete /home/dale/Desktop/Crypt/Video/* >> /mnt/10tb/Video/ > What is going on here is due to a subtle interplay of rsync’s syntax and > shell wildcard expansion. You can read about the details of rsync > syntax in its man page, but I’ll illustrate here: > > rsync has two ways to specify a source directory. > > 1. Without a trailing slash: `rsync path1/source path2/dest`. > This syncs path1/source -> path2/dest/source. > > 2. With a trailing slash: `rsync path1/source/ path2/dest`. > This syncs path1/source -> path2/dest. > > Note that the two ways lead to different target directories getting > synced with the source directory. I think the command you are looking > for is therefore > > time rsync -auv --progress --delete /home/dale/Desktop/Crypt/Video /mnt/10tb > > or > > time rsync -auv --progress --delete /home/dale/Desktop/Crypt/Video/ > /mnt/10tb/Video > > NOTE: I have not tested these commands, I would advise you to run them > with --dry-run first. > > Now, why is your original command not deleting the old subdirectory? > Let me illustrate this with another example. Suppose we have the same > directories as in my first example, path1/source and path2/dest. Now > suppose path1/source contains subdirectories foo and bar. These were > synced with path2/dest, which therefore also contains foo and bar. Now > you rename foo to foo-1 in your source directory. So we have > > $ ls path1/source > foo-1 > bar > > $ ls path2/dest > foo > bar > > When you type path1/source/*, it therefore gets expanded to: > path1/source/foo-1 path1/source/bar > > That’s two different source directories, rsync will sync each > separately to a subdirectory of the same name (because there is no > trailing slash) under path2/dest: > > path1/source/foo-1 -> path2/dest/foo-1 > path1/source/bar -> path2/dest/bar > > And what about path2/dest/foo? Well, it is not included in these two > syncs, so rsync leaves it untouched. The --delete option only affects > what is under your sources and targets, here foo-1 and bar, not foo. > > So, to conclude, what you probably want is to use one of the rsync > commands I listed above, which sync the entire source directory with the > target, and will clean up anything under the target that is not under > the source. Instead, what your old command was doing is to look at > every subdirectory and file of the source one by one, which will miss > anything in the target that does not have a corresponding item in the > source. > > I hope this helps, > > Sincerely, > > Bas > > > -- > Sebastiaan L. Zoutendijk • slzoutendijk@gmail.com > > Replying here for Ramon too.  When I read Ramon's reply earlier, I remembered that the trailing slash and even the "*" I had in there was likely the cause.  I recalled reading how that affects all sorts of things when it comes to copying or moving files ages ago.  Thing is, it can get a little complicated.  However, once one understands how it works, it kinda makes sense that it works that way.  :-D  Reading both replies helped jog my memory, which is awful nowadays.  :-( So for anyone running up on either of these two great explanations, this is what worked for me.  time rsync -auv --progress --delete /home/dale/Desktop/Crypt/Videos /mnt/10tb/ When I ran that, it deleted directories that I had changed the names of or something that were no longer on the source but were still on the target.  Basically, for the source I removed the "/*" part and the directory on the target.  It freed up quite a bit of space too.  That works like I expect it to.  Now to go fix the other backup script thingys so they work right.  No telling how many of those have deleted directories on them.  Thanks much to both.  Reminded me of something I'd forgot about.  Something we should all remember but sadly, I didn't.  :/ Dale :-)  :-)  P. S.  I ordered a 14TB drive. It's a Seagate EXOS X18 14TB ST14000NM000J which I think doesn't have that pin 3 problem.  I got it for $150.  My plan, replace one of the 8TB drives in my system, then I can put the 8TB drive in whatever storage solution I build.  I also measured my current fire safe, I can't find a case that will fit in there that holds enough drives.  I'd have to go with a ITX, Raspberry Pi type thing to get it to fit in the safe and even that could be a tight squeeze.  I could put it in a out building but I really hate to put anything electronic in it.  Stuff grows in there, rust too.  Air is pretty stale and just not good for anything electronic.  This fast internet is causing some problems but I'm still loving it. :-D