How to check integrity of binaries in Artifactory database against filestore?

You may run following method to quickly check integrity of binaries in the database against filestore (assumes that you have a single filestore, such as shared NFS)

1. Get a list of binaries from Artifactory's database by querying sha1 values from "binaries" table

e.g. For MySQL:
a. SELECT sha1 FROM binaries Order By sha1 ASC;
b. save the output as a file

2. Get a list of binaries from Artifactory's filestore.

a. Go to Artifactory's filestore folder (e.g. ../ha-data/filestore/)
b. Run following command
find . -mindepth 2 -type f -printf '%fn' | sort >> binaries-in-filestore.out

3. Find the differences between the results above using your favorite diff tool
e.g. 
User-added image