Skip to content

Instantly share code, notes, and snippets.

@elico
Created July 19, 2016 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elico/5ae8920a4fbc813b415f8304cf1786db to your computer and use it in GitHub Desktop.
Save elico/5ae8920a4fbc813b415f8304cf1786db to your computer and use it in GitHub Desktop.
A script to verify how many private objects are being stored in the store
#!/usr/bin/env bash
#ls /mnt/wu/storedata/header/v1/ | xargs -l1 grep -i "public"
#ls /mnt/wu/storedata/header/v1/ | xargs -l1 grep -i "private"
# Change the directory to reflect your use case
DIR=/mnt/wu/storedata/header/v1/
FILES=($(/bin/ls "$DIR"))
PUBCOUNTER=0
PRICOUNTER=0
ALLCOUNTER=0
for AFILE in ${FILES[@]}
do
# echo $AFILE
grep -i "public" $AFILE >/dev/null && let PUBCOUNTER=PUBCOUNTER+1
grep -i "private" $AFILE >/dev/null && let PRICOUNTER=PRICOUNTER+1
let ALLCOUNTER=ALLCOUNTER+1
done
echo "PUBLIC => $PUBCOUNTER"
echo "PRIVATE => $PRICOUNTER"
echo "ALL => $ALLCOUNTER"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment