Python API: samAdmin v8_1_5
samAdmin.autodestAuditDirectories()

Just having some fun...
This is the python interface to the command 'samadmin autodest audit directories'.
This command is deprecated (no longer actively maintained).
Use at your own risk.

Command Description:

This command performs an auditing function on the number of files currently
in the MSS (Mass Storage Systems) file system.

The intended mode of running is as a daily cron process that checks for any
new files in a directory since yesterday (default for the --date argument)
and report any directories that have filled beyond a specified threshold 
(--max_files argument).  

If any directories fill beyond this threshold, a new directory should be 
created to handle future files. 

This command can be run from the command line without the email option 
specified.  When run with the debug flag (-d), details of all directories 
monitored with the last access times displayed as well as other information.

The command can operate in either of 2 modes:

 1. database mode (DEFAULT)

    The audit is performed using the SAM DATA_FILES table and counts the number
    of files per directory and the last create_date for each directory.  It
    will only report on directories exceeding the specified threshold 
    (--max_files) and have been created in the last day (--date argument).

    It should be noted that the SQL statement performing the summary may take
    a significant (1 minute or better) to query and summarize the data.  This
    should not be cause for alarm.

    By running in this mode, rather than 'filesystem' mode, we remove any impact
    on the /pnfs file system and any performance issues this audit might have
    on storing files.  The SQL query should not have ANY impact on storing 
    files.  (I only mention this as it had been raised as a concern when
    thie command was first implemented and performed it's audit in 'filesystem'
    mode.)

 2. filesystem mode (--filesystem argument)

    When auditing the physical file system in order to expedite the process, 
    the command first 'stats' the directory to determine if it has been written
    to / modified since a specified date (--date option).  If it has not been 
    modified (assumes no new files), then it continues on to the next directory
    assuming that this directory is no longer actively being written to.  This 
    can sometimes lead to misleading results due to the manual procedure 
    sometimes used to mark a file as bad in the ENSTORE system.
          

Python Usage:
	from SamAdmin import samAdmin
	result = samAdmin.autodestAuditDirectories(...)

Return value: 

Arguments are passed as keyword-value pairs, as in:
	 myfunc(arg1='myarg', arg2='anotherarg', d=1)

Argument Keyword Description:
	(*) indicates that this keyword is required
	>>> indicates that either the API object or the CLI equivalent (<<<) is required
====================================================================================================================================
    KEYWORD                    DATA TYPE            DESCRIPTION
------------------------------------------------------------------------------------------------------------------------------------
    c                          SamBoolean           automatically close all servants after each method call
    corbaCallTimeout           int                  time in seconds for CORBA method calls to return before timing out (default: 0; zero implies no timeout)
    d                          SamBoolean           debug mode
    date                       SamTime              
            Checks only those directories that have been written
            to after this date. 
                             
            FORMAT:  YYYY/MM/DD
                             
            The date MUST be entered in the correct format as
            there is no validation performed and the comparison
            on the 'last modified' date of the directory is a
            string comparision.  Unpredictable results will 
            occur.
                             
            DEFAULT: yesterday at 00:00:00
            
    email                      string               
            Email address (group) that will receive 
            notice of any abnormalities found.
            DEFAULT: no email sent 
            
    filesystem                 SamBoolean           
            If specified, the audit will be performed against
            the physical file system defined in SAM's
            AUTO_DESTINATION table by the destination path /
            location_id.
            When specified, this command must be run from a
            platform that has all the auto destination paths
            mounted. 
            
    maxFiles                   long                 
            Maximum number of files allowed in any one 
            directory. Any directories containing files 
            beyond this value will be reported. 
            DEFAULT: 10,000 files.
            
    retryInterval              int                  retry interval base in seconds; will multiply this base times retryCount (default: 5)
    retryJitter                int                  retry jitter, random jitter added to base retry interval times retryCount (default: 5)
    retryMaxCount              int                  number of times to retry CORBA calls for retriable exceptions (default: 25; zero implies no retries)
    s                          SamBoolean           retrySilently mode (do not issue messages to stderr on proxy retries)
    t                          SamBoolean           time-it mode (print additional info on timings)
    v                          SamBoolean           verbose mode
====================================================================================================================================

Environment Defaults:
	c = os.environ['SAM_PYAPI_AUTO_CLOSE_SERVANTS']
	corbaCallTimeout = os.environ['SAM_PYAPI_CORBA_CALL_TIMEOUT']
	retryInterval = os.environ['SAM_PYAPI_RETRY_INTERVAL']
	retryJitter = os.environ['SAM_PYAPI_RETRY_JITTER']
	retryMaxCount = os.environ['SAM_PYAPI_RETRY_MAX_COUNT']
	s = os.environ['SAM_PYAPI_RETRY_SILENTLY']



See Also: