public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Keith Christian <keith1christian@gmail.com>
To: cygwin@cygwin.com
Subject: Help with the prunepaths option with findutils updatedb locate
Date: Thu, 9 Dec 2021 07:16:24 -0700	[thread overview]
Message-ID: <CAFWoy7F8Ss6wH3eF+F+aU86TFd-o_sv1KonuFx0FfoB8puKE7A@mail.gmail.com> (raw)

Fellow Cygwin fans,

I'm trying to keep the many directories with "OneDrive" in the
pathname out of the locatedb file, as I don't care to see them in
locate's output, nor bloat the locatedb file.

I'd appreciate any insight into the prunepaths option for the test
case below, (Line 10,) and how to tell prunepaths to ignore paths with
spaces so that the paths in Lines 5 and 6 below will not be included
in the locatedb file.


     1.   Versions:
     2.   updatedb (GNU findutils) 4.8.0
     3.   CYGWIN_NT-10.0  3.2.0(0.340/5/3) 2021-03-29 08:42 x86_64 Cygwin

     4.   Unfortunately, on this Windows 10 PC there are 650 unique
directory paths with "OneDrive" in them, and these three are the most
numerous:
     5.             /cygdrive/c/Users/corporatedroid/OneDrive - FoobarCorp/
     6.
/home/c_users_corporatedroid/corporatedroid/OneDrive - FoobarCorp/
     7.
/cygdrive/c/Users/corporatedroid/AppData/Local/Microsoft/FoobarCorp/


     8.   With the one-liner below, we create a small locatedb file
(/var/locatedb_prune_test) and specify that prunepaths omit the
'/cygdrive/c/Users/corporatedroid/AppData/Local/Microsoft/OneDrive/ListSync'
subdirectory:
     9.   ==================================
    10.       F=/var/locatedb_prune_test; echo ; updatedb
--localpaths='/cygdrive/c/Users/corporatedroid/AppData/Local/Microsoft/OneDrive'
--output=${F} --prunepaths='/cygdrive/c/Users/corporatedroid/AppData/Local/Microsoft/OneDrive/ListSync'
; ls -l ${F}

    11.           -rw-r--r-- 1 corporatedroid Domain Users 26280 Dec
9 06:22 /var/locatedb_prune_test
    12.   ==================================



    13.   Here, we see that the path ending with 'ListSync'
incorrectly appears in the /var/locatedb_prune_test output despite the
prunepaths option in line 10:
    14.   ==================================
    15.       F=/var/locatedb_prune_test;locate -d${F} 'ListSync'|cat -n|tail -3
    16.           33
/cygdrive/c/Users/corporatedroid/AppData/Local/Microsoft/OneDrive/logs/ListSync/Business1/Nucleus-2021-12-09.1317.15440.1.odl
    17.           34
/cygdrive/c/Users/corporatedroid/AppData/Local/Microsoft/OneDrive/logs/ListSync/Business1/microsoftNucleusTelemetryCache.otc
    18.           35
/cygdrive/c/Users/corporatedroid/AppData/Local/Microsoft/OneDrive/logs/ListSync/Business1/telemetry-dll-ramp-value.txt
    19.   ==================================

Any ideas appreciated.

             reply	other threads:[~2021-12-09 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 14:16 Keith Christian [this message]
2021-12-09 16:12 ` Brian Inglis
2021-12-10 13:04   ` Keith Christian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFWoy7F8Ss6wH3eF+F+aU86TFd-o_sv1KonuFx0FfoB8puKE7A@mail.gmail.com \
    --to=keith1christian@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).