X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EACF43858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca X-Authority-Analysis: v=2.4 cv=Fe4keby6 c=1 sm=1 tr=0 ts=61b22ae9 a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17 a=IkcTkHD0fZMA:10 a=Vt2AcnKqAAAA:8 a=w_pzkKWiAAAA:8 a=TImcKGuyeGIbufSLrCcA:9 a=QEXdDO2ut3YA:10 a=v10HlyRyNeVhbzM4Lqgd:22 a=sRI3_1zDfAgwuvI8zelB:22 Message-ID: Date: Thu, 9 Dec 2021 09:12:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: Help with the prunepaths option with findutils updatedb locate Content-Language: en-CA To: cygwin AT cygwin DOT com References: From: Brian Inglis Organization: Systematic Software In-Reply-To: X-CMAE-Envelope: MS4xfOrduxiMBgi/s3R6VxmIEA59QJgQq45pndVuDiDbHdhwnGDN66lu/d7OtoZBWzXuHzjvlD/5S4e3YZ2ADOHM+5xCiZoi1Tz0M5HP9e+V7YHF+myVaBsZ 39rF1atAq1q5Duu4/E6H9rWwREm0dE0UJ99sv5P9kafDp78NBuSzQKKp6gN01EFBQ6d1Jvhdq89fqM+htVtmvM4U9WDk1sqMas8= X-Spam-Status: No, score=-1165.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On 2021-12-09 07:16, Keith Christian wrote: > 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. > 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: > 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 > 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: > 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 > Any ideas appreciated. Search: https://www.mail-archive.com/search?l=cygwin%40cygwin.com&q=updatedb e.g. https://www.mail-archive.com/cygwin AT cygwin DOT com/msg146142.html for operational hints. For info: $ info updatedb /--prunepaths= $ info -- find -regex The option --prunepaths takes an argument containing a space separated list of find ... -regex (Basic) REs which match *complete* directory paths to prune from: if absolute, these start with / and end without one; try an argument list where USER=corporatedroid and CORP=FoobarCorp like for example: "/.*[Uu]sers.*$USER.*OneDrive.* /.*[Uu]sers.*$USER.*$CORP.* /.*[Uu]sers.*$USER.*ListSync.* /[^[:space:]]*" or even: "/.*[Uu]sers.*$USER.*\(OneDrive\|$CORP\|ListSync\).* /[^[:space:]]*" You may want to be sure those directories are mounted as --localpaths rather than --netpaths which have additional requirements: $ cat /proc/filesystems vfat exfat ntfs refs nodev smbfs nodev nfs nodev netapp iso9660 udf nodev csc-cache nodev unixfs nodev mvfs nodev cifs nodev nwfs nodev ncfsd nodev afs nodev prlfs $ mount C:/cygwin/bin on /usr/bin type ntfs (binary,auto) C:/cygwin/lib on /usr/lib type ntfs (binary,auto) C:/cygwin on / type ntfs (binary,auto) C: on /cygdrive/c type ntfs (binary,posix=0,noumount,auto) ... [Please don't post with extra spaces, step nos (use text refs instead), or long command lines, as many devs and some users read with mono fonts and short wrap margins e.g 72, 80. You could use updatedb env vars instead of options for readability.] -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple