Bug 1383723

Summary: [GSS][RFE] provide option in glusterfind to display only files as well
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Cal Calhoun <ccalhoun>
Component: glusterfindAssignee: Shwetha K Acharya <sacharya>
Status: CLOSED ERRATA QA Contact: Kshithij Iyer <kiyer>
Severity: high Docs Contact:
Priority: low    
Version: rhgs-3.1CC: apaladug, bkunal, dwalveka, kiyer, mchangir, musoni, pprakash, puebele, rhs-bugs, rkothiya, sacharya, saraut, sheggodu, storage-qa-internal, sunkumar
Target Milestone: ---Keywords: FutureFeature, Rebase, ZStream
Target Release: RHGS 3.5.z Batch Update 3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-6.0-38 Doc Type: Enhancement
Doc Text:
With this enhancement, an option "--type {f,d,both}: type: f, f-files only ; d, d-directories only ; by default = both` is added in glusterfind commands. This option is to be used with the "--full" option. Filter logic is added to selectively print the output based on the argument type.
Story Points: ---
Clone Of:
: 1392347 1662626 (view as bug list) Environment:
Last Closed: 2020-12-17 04:50:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1392347    
Bug Blocks: 1408949, 1468976, 1662626    

Description Cal Calhoun 2016-10-11 15:11:36 UTC
Description of problem:

  Output of glusterfind includes directories so passing that output to a backup program effectively ignores file lists.  Request an output option similar to 'find -type t' to only output filenames.

Version-Release number of selected component (if applicable):

  RHGS 3.1.3

How reproducible:

  Requested feature.

Comment 2 Milind Changire 2016-11-07 07:30:34 UTC
Some post-processing could be added on glusterfind output outside of glusterfind to weed out directories. All "NEW ..." entries could be tested for the directory flag as:

while read line;
do
    op=$(echo $line | cut -f 1 -d ' ')
    if [ "$op" == "NEW" ]; then
        name=$(echo $line | cut -f 2 -d ' ')
        # if the name doesn't point to a directory, we'll keep it
        if [ ! -d "$name" ]; then
            echo $line
        fi
    else
        echo $line
    fi
done < glusterfind-output.txt

-----

Please note that the above script doesn't handle encoded paths in glusterfind output and needs appropriate handling if need be.

Comment 13 Shwetha K Acharya 2019-01-05 02:56:53 UTC
REVIEW:https://review.gluster.org/#/c/glusterfs/+/21965/

Comment 18 Yaniv Kaul 2019-07-22 08:27:20 UTC
Can we get a PM ack and move forward with this to 3.5.1?

Comment 37 errata-xmlrpc 2020-12-17 04:50:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (glusterfs bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5603