Last active
December 14, 2015 23:09
-
-
Save aravindavk/5163516 to your computer and use it in GitHub Desktop.
glusterfs adds 'trusted.gfid' as extended attribute to the files and creates hard link to that file in .glusterfs directory. This script accepts gfid as parameter and finds respective file in system.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# glusterfs adds 'trusted.gfid' as extended attribute to the files | |
# and creates hard link to that file in .glusterfs directory | |
# This script accepts gfid as parameter and finds respective file in | |
# system | |
# Example Usage: | |
# ./file-by-gfid f6b2307a-8d3f-4e61-94eb-c565f48240fb | |
META_DIR=.glusterfs/ | |
function main() | |
{ | |
gfid=$1; | |
to_search=$META_DIR${gfid:0:2}"/"${gfid:2:2}"/"$gfid; | |
find . -samefile $to_search | grep -v $to_search; | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment