Skip to main content
Version: OpCon (Cloud - Current)

SMADirectory

Theme: Configure
Who Is It For? System Administrator, Automation Engineer

What Is It?

SMADirectory (SMADirectory.exe) manages OpCon directories, keeping log and report directories from consuming excessive disk space.

Based on user criteria and filters, the utility can:

  • Delete files
  • Zip (compress) files
  • Move files (for full recursive directories)
  • Recover files (for full recursive directories)

Configuration Options

Backwards Compatibility

This utility is compatible with SMADeleteOldFiles and ClearDir. Customers who wish to convert should contact Continuous.

Requirements

  • Microsoft agent
  • Microsoft .NET Framework 4.5

Syntax

SMADirectory supports dash, forward slash, and comma-delimited arguments.

note

SMADirectory uses (US) English localization exclusively. It only accepts US settings or command-line values.

Dash Argument

The SMADirectory.exe program accepts arguments using dash.

note

Continuous recommends using the dash (-) argument for full utility capability.

Example

SMADirectory.exe -d "c:\Test" -r -e *.*

Parameters

ParameterNameDefaultDescription
-bBinRecover filesRecovers files to the default location: <driveTarget>\ProgramData\OpConxps\MSLSAM\SMADirectory\<directoryTarget>. Use -o to set a custom location.
-cTime to Retain5DSpecifies how long files are retained. Format: <Number><TimeSpan> where TimeSpan is D (day), H (hour), X (month), M (minute), S (second), or Y (year). Example: 5D
-dDirectory NameRequired. The folder to clean up or move.
-eExtensionsRequired. Accepts pipe-separated extensions and/or filters.
-FTimeTypeFMTime type used for file processing: FA (last access), FM (last modification), or FC (creation date)
-hNo HiddenProcess hidden and system filesExcludes system and hidden files from processing.
-mMoveNullPath to move a folder. When -m and/or -z are entered, the program performs a move instead of a delete. If -z is also entered, the folder is zipped. This is the only scenario where -x (delete) may be used.
-oRecoverPath%ProgramData%/OpConxps/SMADirectorySets a custom recovery location when recovery is enabled. Only qualifying files are recovered.
-rRecursiveOffProcesses subfolders and their files.
-uDebugEnables debug mode.
-vVerboseNoPrints names of non-deleted files.
-xDeleteOffDeletes files after move or zip when -m or -z is specified. Useful when only the zip file is needed as output.
-zZipNo compressionCompresses (zips) moved files. Requires a zip filename; if omitted, uses the format zip.currentdate.zip (e.g., zip.03212016.zip). Compression occurs after the move. -x may only be used when both -m and -z are included.

Forward Slash Argument

Forward slash is supported for backwards compatibility with cleardir.exe and works the same as dash switches.

Example

SMADirectory.exe /d "c:\Test" /r /u /e *.*

Comma Delimited Argument

Comma-delimited syntax is supported for backwards compatibility with SMADeleteOldFiles. It only supports file deletion (not move or compress) and requires exactly three parameters.

<Target Directory>\OpConxps\MSLSAM\SMADirectory.exe Directory,DaysToRetain,FileExtensions

Parameters

  • \<Target Directory>: Path to the OpCon installation folder (e.g., C:\\Program Files\)
  • Directory: Path to the directory to examine
  • DaysToRetain: Number of days to retain files
    • Must be entered in English (e.g., 5d)
    • Must be greater than zero and less than 32,757
  • FileExtensions: File extensions for the retention period (e.g., log)
    • Specify multiple extensions separated by commas
    • Use wildcard (*) to apply to all files

Example

Example

Deletes any log files older than 5 days:

"C:\Program Files\OpConxps\MSLSAM\SMADirectory"
"C:\ProgramData\OpConxps\SAM\Log,5,log"

Note: No period precedes the extension.

Exit Codes

Exit CodeSample CommandMessageStatus Description
202-eLess parameters
203-d C:\Source -c 20W[GetTimeCounter] Invalid Counter. Cannot be equal or less than zero...[GetTimeOptions] Error while loading settings.Wrong Counter Letter
203-d C:\Source -c -5D[GetTimeCounter] Invalid Counter. Cannot be equal or less than zero...[GetTimeOptions] Error while loading settings.Negative Counter
204-d C:\Source -c 0D[GetTimeCounter] Invalid CounterZero Counter
205-d C:\Source -c 5d -e .The Directory does not exitsDirectory specified is invalid.
206-d C:\Source -c5D -e *.log -2Invalid Option. Zip File Name is Required.
206-d C:\Source -c5DInvalid Options. The -e is Required.
Exit CodeSample CommandMessageStatus Description
202C:\Source[Main] Invalid number of argumentsLess parameters
203C:\Source,5W,log[ParseComaDelimited][SetCounter] Invalid Counter. Cannot be equal or less than zero...Invalid Counter Letter
203C:\Source,W,log[ParseComaDelimited][SetCounter] Invalid Counter. Counter is not numericCounter is a letter
204C:\Source,0,log[ParseComaDelimited][SetCounter] Invalid Counter. Cannot be equal or less than zero...Zero Counter
204C:\Source,-5,log[ParseComaDelimited][SetCounter] Invalid Counter. Cannot be equal or less than zero...Negative Counter
205C:\InvalidFolder,0,logThe Directory does not exitsDirectory specified is invalid.
206-d C:\Source,5,logExit Status 206Invalid Options

FAQs

Q: What file management operations does SMADirectory support?

SMADirectory can delete files, compress (zip) files, move files for full recursive directories, and recover files for full recursive directories.

Q: What are the requirements for running SMADirectory?

SMADirectory requires the Microsoft agent and Microsoft .NET Framework 4.5. It uses US English localization exclusively and only accepts US settings or command-line values.

Q: Is SMADirectory backwards compatible with older utilities?

Yes. SMADirectory is compatible with SMADeleteOldFiles and ClearDir. Customers who want to convert from those utilities should contact Continuous.

Glossary

SAM (Schedule Activity Monitor): The logical processor for OpCon workflow automation. SAM monitors schedule and job start times, dependencies, and user commands to determine job execution timing, and processes OpCon events.

LSAM (Local Schedule Activity Monitor): An agent installed on a target platform that runs jobs in the native language of that platform and communicates results back to SAM via SMANetCom over TCP/IP.

OpConxps: The standard installation directory name for OpCon program files, configuration files, and output data on Windows machines.

OpCon: Continuous' workflow automation platform. The OpCon server includes the database, SAM and Supporting Services (SAM-SS), and graphical user interfaces. agents installed on target platforms run jobs and report results.