<commit_before># Gluster Directories Health Check

A tool to detect stale or boken directories in Gluster bricks. This tool can detect following issues

**No GFID**: If a directory in brick backend doesn't have `trusted.gfid` xattr  
**No Parent GFID**: Parent directory doesn't have a `trusted.gfid` xattr  
**No Symlink**: Gluster maintains a symlink in `$BRICK/.glusterfs` directory for each directory, If Symlink file not present for a directory  
**Wrong Symlink**: If symlink exists but linked to different directory  
**Invalid GFID**: Invalid data in `trusted.gfid` xattr  
**Invalid Parent GFID**: Invalid data in `trusted.gfid` xattr of parent dir  

## Install
If Rust is installed in your machine then run the following

    cargo install --git https://github.com/aravindavk/gluster-dir-health-check

The easiest way to get this tool is to download a binary and place it in a directory within your $PATH, such as /usr/local/bin.

    wget https://github.com/aravindavk/gluster-dir-health-check/releases/download/v0.1.1/gluster-dir-health-check-linux-x86_64.tar.gz
    sudo mv gluster-dir-health-check /usr/local/bin/

## Usage

    gluster-dir-health-check <brick_path>

Example:

    gluster-dir-health-check /bricks/b1<commit_msg>Added download link<commit_after># Gluster Directories Health Check

A tool to detect stale or boken directories in Gluster bricks. This tool can detect following issues

**No GFID**: If a directory in brick backend doesn't have `trusted.gfid` xattr  
**No Parent GFID**: Parent directory doesn't have a `trusted.gfid` xattr  
**No Symlink**: Gluster maintains a symlink in `$BRICK/.glusterfs` directory for each directory, If Symlink file not present for a directory  
**Wrong Symlink**: If symlink exists but linked to different directory  
**Invalid GFID**: Invalid data in `trusted.gfid` xattr  
**Invalid Parent GFID**: Invalid data in `trusted.gfid` xattr of parent dir  

## Install
If Rust is installed in your machine then run the following

    cargo install --git https://github.com/aravindavk/gluster-dir-health-check

The easiest way to get this tool is to download a binary from [here](https://github.com/aravindavk/gluster-dir-health-check/releases/download/v0.1.1/gluster-dir-health-check-linux-x86_64.tar.gz) and place it in a directory within your $PATH, such as /usr/local/bin.

    wget https://github.com/aravindavk/gluster-dir-health-check/releases/download/v0.1.1/gluster-dir-health-check-linux-x86_64.tar.gz
    sudo mv gluster-dir-health-check /usr/local/bin/

## Usage

    gluster-dir-health-check <brick_path>

Example:

    gluster-dir-health-check /bricks/b1
{'fraction_non_alphanumeric': 0.0980243161094225, 'fraction_numerical': 0.008738601823708206, 'mean_word_length': 4.122568093385214, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5022059', 'n_tokens_mistral': 851, 'n_tokens_neox': 810, 'n_words': 291}