Try TT Now

All Gateways

TTClean

Overview

TTClean automates your system cleanup and maintenance. TTClean installs into <root drive>:ttbin and uses a file called ttclean.ini to determine the specific set of tasks that it performs. For information on ttclean.ini, refer to ttclean.ini.

You can configure TTClean to perform the following functions on files in a specified directory and older than a specified date:

  • Purge files: Deletes all files
  • Rename / Move files: Renames and if needed moves, groups of files
  • Delete directories: Deletes empty subdirectories

By default, the TT Gateway installs with TTClean configured to retain the ten most recent log files of a particular type. TTClean is set to purge all older log files.

Note

For a list of files that TTClean does not touch, refer to Ignored File Extensions.

Additionally, you can use command line parameters to determine whether TTClean generates a log file or outputs verbose command window feedback. TTClean's log file is saved to <root drive>:ttlogfiles and named: TTCleanLog-DT_HHMMSS.log, where DT consists of the two-digit month, two-digit day, and the last two digits of the year.

Command Line Syntax

You can run TTClean in a command window with the following options:

ttclean [-n | -b | -v | -i | -?]

By default, TTClean uses the -b option.

Tip

If you use a TTClean section in ttchron.ini, you can include these command line parameters in the args parameter.

TTClean Command Line Options
OptionDescription
-n

Sets TTClean to not provide output in the Command Window nor does it create a TTClean log file.

-b

Provides brief (basic) output in the Command Window and log file. The output includes the name of the command and any error messages.

-v

Provides verbose feedback in the Command Window and log file. The output includes the name of the command, the names of any files affected by the command, and any error messages.

-i or -?

Provides command line help and information in the command window.

Running TTClean

You can run TTClean without using a Command Window by double-clicking the TTClean.exe file.

TTClean on Non‑TT Machines

To install TTClean on a non-TT Gateway (i.e. a MISS Device), you must create the directory <root drive>:TTClean and then copy TTClean.exe and the ttclean.ini file into this directory.

If you want to run TTClean from a command window on a non-TT machine, you must do one of the following tasks:

  • Include the absolute path and filename of the TTClean application in your command line.

    E:TTCleanTTClean.exe

  • Issue the TTClean command from the directory that contains the TTClean.exe file.
  • Add the absolute path (without the filename) to the Path System Variable. If you choose this option, you can use the standard TTClean syntax in the future whenever you run TTClean.

Setting TTClean’s System Variable

Note

The following procedure assumes that you created a folder named TTClean at the root level of the installation drive. See the preceding section.

Perform the following procedure only if you install TTClean on a non-TT machine.

To add TTClean’s Absolute Path to the Path System Variable:

  1. From the Start menu, point to Settings, and click Control Panel.

    The Control Panel displays.

  2. Double-click System.

    The System Properties dialog box displays.

  3. In the Advanced tab, click Environment Variables.
  4. Scroll through the System Variables list box to locate Path, click it, and then click Edit.

    The Edit System Variable prompt box displays. The Variable Value box displays all values associated with Path:

  5. Click to place your cursor at the beginning of the text in the Value box.
  6. Type: <root drive>:TTClean;

    You must end this value with a semi-colon (;).

  7. To save this path and close the Edit System Variable prompt box, click OK.
  8. To save your changes and close the Environment Variables dialog box, click OK.
  9. To close the System Properties dialog box, click OK.

Automating TTClean

You can use ttchron.ini to automate the TTClean application. ttchron.ini installs with the following active section:

Example Automating TTClean

The following section sets TTChron to run TTClean at 10:15 PM everyday (Monday through Sunday) using the command line option -V.

[win32-TTClean]

path=c:ttbinttclean.exe

args=-V

schedule=SMTWRFB@22:15

ttclean.ini

By default, ttclean.ini installs with:

TTClean references ttclean.ini (located in <root drive>:ttconfig) whenever it runs. You must configure this file with all of the actions you want TTClean to perform.

  • Active instructions to purge the following directories of all files older than ten days:
    • <root drive>:ttauditfiles
    • <root drive>:ttlogfiles
    • <root drive>:ttdatfilesDBArchive
  • Commented-out sets of commands specific to the TT MISS Gateways. To enable the commands specific to the TT MISS Gateways, you must uncomment the appropriate line(s) of text by removing the # sign at the beginning of the particular line.

Before activating any lines in ttclean.ini (uncommenting them), TT recommends that you determine what the line is set to do.

Note

Commands in ttclean.ini are not sensitive to case.

Purging Files

When you want TTClean to purge (i.e., delete) files from your machine on a regular basis, add a purge command line to the ttclean.ini file. However, because of potential disasters, TTClean does not perform the purge function on any root drive directory.

Syntax

To purge files, use the following syntax:

p, NumFilesToKeep, Directory, Filename, [subdir]

TTClean Purge Parameters

Parameter

Description

p

Activates TTClean's purge function

NumFilesToKeep

Sets the number of most recent files of the specified Filename that TTClean keeps. TTClean purges all older files.

For example, to retain the last five files of a particular type and delete all older files, set NumFilesToKeep to 5.

Directory

Sets the directory that TTClean scans for files to delete.

Filename

Sets the filename of the file you want TTClean to delete. You can use wild cards when specifying filenames.

For example, to purge all files that end in .log, use *.log.

subdir

Optional. Sets TTClean to purge recursively. All subdirectories of the directory you specified (in Directory) are also searched for files to delete.

For example, if you set directory to E:tt and include subdir, TTClean purges files from the tt folder as well as all of its sub-directories (e.g., bin, config, datfiles, etc.).

Purge Example-Auditfiles

Example Retaining the Last 5 Files

This entry configures TTClean to retain the five (5) most recent files of any type (*.*) in the directory e:ttauditfiles.

p, 10, e:ttAuditFiles, *.*

In this example, the Auditfile directory contained the following files prior to purging:

After purging, the only the five (5) most recent files remain:

Purge Example-Logifles

Example Retaining the Last Five Logfiles

This entry configures TTClean to retain the five (5) most recent log files (*.log) in the directory e:ttlogfiles and any subdirectories (subdir).

p, 10, e:ttlogfiles, *.log, subdir

In this example, the Logfile directory contained the following files prior to purging:

After purging, the only the three (3) most recent of each logfile remains:

Moving and Renaming Files

When you want TTClean to rename and move files on your machine on a regular basis, add a rename command line to the ttclean.ini file.

Tip

A useful technique for the rename function is to rename and move all old log files into an archive directory for backup purposes.

Syntax

When renaming (or moving) files, use the following syntax:

r, Days, AbsoluteName, FutureAbsoluteName

TTClean Rename and Move Parameters

Parameter

Description

r

Activates TTClean's rename function

Days

Sets the acceptable age of files in days. TTClean renames all files older than this age.

For example, to rename all files older than five days, set Days to 5.

AbsoluteName

Sets the absolute directory path and filename of the file(s) that you want to rename. You can use wildcards (i.e., *) to specify multiple filenames.

For example, to rename all files in E:ttlogfiles that end in .log, type: E:ttlogfiles*.log.

FutureAbsoluteName

The absolute directory path where you want to move the file(s). The filename must include the symbol @ before the file's extension. TTClean does not create new folders, so you must enter an absolute directory that consists of preexisting folders.

You must include an @ sign to merge the date to the filename. The date consists of the two-digit month, two-digit day, and the last two digits of the year.

For example, to move (and rename) the *.log files to C:Backup, type: C:Backup@.log

Moving and Renaming Examples

Example Renaming and Moving Files

r, 3, e:ttlogfiles*.log, e:ttBackUp@.log

This entry configures TTClean to rename and move all log files (*.log) in the directory e:ttlogfiles older than three days (3) to the directory e:ttBackUp. Each file has the date appended to its name before the “.log.”

For example, Guardian.log becomes GuardianDate.log.

Example Renaming Logfiles

r, 3, e:ttlogfiles*.log, e:ttlogfiles@.log

This entry configures TTClean to rename all log files (*.log) in the directory e:ttlogfiles that are older than three days (3). Each file has the date appended to its name before the “.log.”

For example, Guardian.log becomes GuardianDate.log.

Deleting Subdirectories

When you want TTClean to delete empty subdirectories from your machine on a regular basis, add a delete subdirectory command line to the ttclean.ini file.

Syntax

When deleting empty subdirectories, use the following syntax:

s, Directory

TTClean Delete Subdirectories Parameters

Parameter

Description

s

Activates TTClean's subdirectory delete function

Directory

Sets the directory that TTClean scans recursively. TTClean deletes any empty subdirectories (folders) of the specified Directory

Deleting Subdirectories Example

Example Deleting Subdirectories

s, e:tt

This entry configures TTClean to delete all empty subdirectories of e:tt:

Ignored File Extensions

Due to their sensitive nature, TTClean ignores any files with an extension listed in the following table. Even if you specifically target a file that ends in an extension contained in this list, TTClean ignores the file and does nothing to it.

Ignored File Extensions (TTClean)
Ignored File Extensions

386

CSC

ICO

MSO

RTF

VST

ACMCSHINFOBDSCRVXD
ACVDLLINIOBTSHWSF
ADTDOCJSOGLSHBWSH
AXDOTJSEOCXSHSXLA
BATDRVJTDPDBSMMXLS
BINEXEMDBPIFSYSXLT
BTMHLPMP3PLTXTXLW
CFGHTAMPDPMVBE
CLAHTMMPJPOTVBS
COMHTMLMPPPPSVSD
CPLHTTMPTPPTVSS