Package: s3-storage-stats
s3-storage-statsInstallationLinux:pip3installs3-storage-statsThis will install all necessary dependencies and create the executable
'/usr/local/bin/s3-storage-stats'UsageMake sure the user that runs it is able to read the s3 configuration file.s3-storage-stats-h
usage:s3-storage-stats[-h]{checksums,reports}...

positionalarguments:{checksums,reports}checksumsobtainandoutputobject/filechecksumsreportsobtainandoutputstoragereports

optionalarguments:-h,--helpshowthishelpmessageandexitSub-commandsChecksumsThe checksums sub-command has two sub-commands itself:getA client gives the filename and the type of checksum hash to obtain.
If this information is found, it will be printed to stdout. If not,
'None' will be printed out.In its simplest form it requires two positional arguments:s3-storage-statschecksumsget-f[FILE]-t[HASH_TYPE]The name option specifies the name of the s3 service. It is used to
create the logfile path if not otherwise specified. The example below
will create the logfile at /var/log/xrootd/s3_proxy/s3_storage_stats.log:s3-storage-statschecksumsget-f[FILE]-t[HASH_TYPE]-ns3_proxyA more complex example specifying configuration file, logging file,
logging level and verbosity:s3-storage-statschecksumsget-f[FILE]-t[HASH_TYPE]-c/etc/xrootd/s3_config--loglevel=WARNING--logfile='/var/log/s3-storage-stats/s3_storage_stats.log'-vHelp:s3-storage-statschecksumsget-h
usage:s3-storage-statschecksumsget[-h][-cCONFIG_PATH][--force][-v][--logfileLOGFILE][--loglevel{DEBUG,INFO,WARNING,ERROR}][-nXROOTD_NAME]-tHASH_TYPE-fFILE

optionalarguments:-h,--helpshowthishelpmessageandexit-cCONFIG_PATH,--configCONFIG_PATHPathtos3endpoint.conffileordirectory.Acceptsoneargument.Default:'/etc/xrootd/s3cfg'.--forceForcecommandexecution.-v,--verboseShowonstderreventsaccordingtologlevel.

Loggingoptions:--logfileLOGFILESetlogfilespath.Default:/var/log/xrootd/[XROOTD_NAME]/s3_storage_stats.log--loglevel{DEBUG,INFO,WARNING,ERROR}Setlogoutputlevel.Default:WARNING.-nXROOTD_NAME,--nameXROOTD_NAMESetthenameofthexrootdinstance.Usedinthelogfilepath.Default:''Checksumrequiredoptions:-tHASH_TYPE,--hash_typeHASH_TYPETypeofchecksumhash.['adler32',md5]Required.-fFILE,--fileFILEURLofobject/filetorequestchecksumof.Required.putA client gives the filename, checksum, and type of checksum has to add this information
to the file's metadata. Nothing is returned unless the process encounters errors.In its simplest form it requires three positional arguments:s3-storage-statschecksumsput-f[FILE]-t[HASH_TYPE]--checksum[CHECKSUM]The name option specifies the name of the s3 service. It is used to
create the logfile path if not otherwise specified. The example below
will create the logfile at /var/log/xrootd/s3_proxy/s3_storage_stats.log:s3-storage-statschecksumsput-f[FILE]-t[HASH_TYPE]--checksum[CHECKSUM]-ns3_proxyA more complex example specifying configuration file path, logging file and level,
and verbosity:s3-storage-statschecksumsput-f[FILE]-t[HASH_TYPE]--checksum[CHECKSUM]-c/etc/xrootd/s3_config--loglevel=WARNING--logfile='/var/log/s3-storage-stats/s3_storage_stats.log'-vHelp:s3-storage-statschecksumsput-h
usage:s3-storage-statschecksumsput[-h][-cCONFIG_PATH][--force][-v][--logfileLOGFILE][--loglevel{DEBUG,INFO,WARNING,ERROR}][-nXROOTD_NAME]-tHASH_TYPE-fFILE--checksumCHECKSUM

optionalarguments:-h,--helpshowthishelpmessageandexit-cCONFIG_PATH,--configCONFIG_PATHPathtos3endpoint.conffileordirectory.Acceptsoneargument.Default:'/etc/xrootd/s3cfg'.--forceForcecommandexecution.-v,--verboseShowonstderreventsaccordingtologlevel.

Loggingoptions:--logfileLOGFILESetlogfilespath.Default:/var/log/xrootd/[XROOTD_NAME]/s3_storage_stats.log--loglevel{DEBUG,INFO,WARNING,ERROR}Setlogoutputlevel.Default:WARNING.-nXROOTD_NAME,--nameXROOTD_NAMESetthenameofthexrootdinstance.Usedinthelogfilepath.Default:''Checksumrequiredoptions:-tHASH_TYPE,--hash_typeHASH_TYPETypeofchecksumhash.['adler32',md5]Required.-fFILE,--fileFILEURLofobject/filetorequestchecksumof.Required.--checksumCHECKSUMStringwithchecksumtoset.Required.ReportsThe reports command calculates and outputs the total bytes used in the s3 storage
followed by the number of files.In its simplest form, the reports command requires no addition arguments:s3-storage-statsreportsThe name option specifies the name of the s3 service. It is used to
create the logfile path if not otherwise specified. The example below
will create the logfile at /var/log/xrootd/s3_proxy/s3_storage_stats.log:s3-storage-statsreports-ns3_proxyThe prefix option allows the user to specify a path prefix for the file and byte counts.
This can be used to count only the files in a specific directory:s3-storage-statsreports--prefix='/directory_name'A more complex example specifying configuration file path, logging file and level,
and verbosity:s3-storage-statsreports-c/etc/xrootd/s3_config--loglevel=WARNING--logfile='/var/log/s3-storage-stats/s3_storage_stats.log'-vHelp:s3-storage-statsreports-h
usage:s3-storage-statsreports[-h][-cCONFIG_PATH][--force][-v][--logfileLOGFILE][--loglevel{DEBUG,INFO,WARNING,ERROR}][-nXROOTD_NAME][-pPREFIX]{}...

positionalarguments:{}optionalarguments:-h,--helpshowthishelpmessageandexit-cCONFIG_PATH,--configCONFIG_PATHPathtos3endpoint.conffileordirectory.Acceptsoneargument.Default:'/etc/xrootd/s3cfg'.--forceForcecommandexecution.-v,--verboseShowonstderreventsaccordingtologlevel.

Loggingoptions:--logfileLOGFILESetlogfilespath.Default:/var/log/xrootd/[XROOTD_NAME]/s3_storage_stats.log--loglevel{DEBUG,INFO,WARNING,ERROR}Setlogoutputlevel.Default:WARNING.-nXROOTD_NAME,--nameXROOTD_NAMESetthenameofthexrootdinstance.Usedinthelogfilepath.Default:''Reportoptions:-pPREFIX,--prefixPREFIXPrefixfordirectorypath.Default:''ConfigurationThe configuration file should be in the following format:# Setup endpointhost_base=[ENDPOINT_URL]host_bucket=[ENDPOINT_URL]/[BUCKET]region=[REGION]use_https=boolean# Setup access keysaccess_key=[ACCESS_KEY]secret_key=[SECRET_KEY]# Enable S3 v4 signature APIsignature_v2=booleanReferencesBased on:https://pypi.org/project/dynafed-storagestats/[Source Code]https://github.com/hep-gc/dynafed_storagestats