2019: How-To: Using %DATE% variables in the Event Manager

2019: How-To: Using %DATE% variables in the Event Manager

There may be a situation in the Event Manager when access to a specific date is required. For example, you may have a scheduled event that runs at midnight and needs to backup or move all logfiles from yesterday. Since this event is scheduled to run nightly, the date will dynamically change.

Titan FTP Server and Cornerstone MFT Server 2019 have the following 'date' variables for use in the event management system.

%TIME%
%TIMEONLY%
%DATEONLY%
%DATETIMEEX%
%DATE.TODAY.BOY%
%DATE.TODAY.EOY%
%DATE.YESTERDAY%
%DATE.YESTERDAY.RAW%
%DATE.TODAY.DAY%
%DATE.TODAY.MONTH%
%DATE.TODAY.YEAR%
%DATE.YESTERDAY.DAY%
%DATE.YESTERDAY.MONTH%
%DATE.YESTERDAY.YEAR%
%DATE.TODAY%
%DATE.TODAY.RAW%
%DATE.MONTH.THIS.BOM%
%DATE.MONTH.THIS.BOM.RAW%
%DATE.MONTH.THIS.EOM%
%DATE.MONTH.THIS.EOM.RAW%
%DATE.MONTH.LAST.BOM%
%DATE.MONTH.LAST.BOM.RAW%
%DATE.MONTH.LAST.EOM%
%DATE.MONTH.LAST.EOM.RAW%
%DATE.MONTH.LAST%
%DATE.MONTH.LAST.YEAR%
%DATE.MONTH.THIS%
%DATE.MONTH.THIS.YEAR%

Hint: To see exactly what is printed for each of these variables, set up a test event, such as On Logfile Rotated with an action to Write To Custom File and dump the values of these variables. The Action could look like....

DATE.TODAY = %DATE.TODAY%,
DATE.MONTH.THIS.BOM.RAW = %DATE.MONTH.THIS.BOM.RAW%

and would produce

TIME -> 2019-06-14 17:01:02
TIMEONLY -> 17:01:02
DATEONLY -> 2019-06-14
DATETIMEEX -> 20190614170102
DATE.TODAY.BOY -> 2019-01-01
DATE.TODAY.EOY -> 2019-12-31
DATE.YESTERDAY -> 2019-06-13
DATE.YESTERDAY.RAW -> 20190613
DATE.TODAY.DAY -> 14
DATE.TODAY.MONTH -> 06
DATE.TODAY.YEAR -> 19
DATE.YESTERDAY.DAY -> 13
DATE.YESTERDAY.MONTH -> 06
DATE.YESTERDAY.YEAR -> 2019
DATE.TODAY -> 2019-06-14
DATE.TODAY.RAW -> 20190614
DATE.MONTH.THIS.BOM -> 2019-06-01
DATE.MONTH.THIS.BOM.RAW -> 20190601
DATE.MONTH.THIS.EOM -> 2019-06-30
DATE.MONTH.THIS.EOM.RAW -> 20190630
DATE.MONTH.LAST.BOM -> 2019-05-01
DATE.MONTH.LAST.BOM.RAW -> 20190501
DATE.MONTH.LAST.EOM -> 2019-05-31
DATE.MONTH.LAST.EOM.RAW -> 20190531
DATE.MONTH.LAST -> 05
DATE.MONTH.LAST.YEAR -> 2019
DATE.MONTH.THIS -> 06
DATE.MONTH.THIS.YEAR -> 2019

etc...

Note: these variables are available in Titan 2019 and Cornerstone 2019 and later. They are not available in older versions of the software.



    • Related Articles

    • 2019: How-To: Using Event Manager Variables for log file access

      There are times in the Event Manager when access to the server logfile name is needed. For example, you may want to move the previous logfile offsite to a new folder once the logfile is rotated. Or, you may want to know the filename of the current ...
    • Custom Branding using PowerShell Script

      Titan Server: Custom Branding and Logo using PowerShell Question How do I custom brand the interface for Titan Server using a PowerShell script? Reasoning I want the interface to match my organization’s look and feel. Answer Yes, the server interface ...
    • Deleting old log files

      The Run File/Script action in the Titan/Cornerstone 2019 Events Management system can be used to delete old log files from the system. the parameters must be File/Script: cmd.exe parameter 1: /c del /F /Q parameter 2: "<the target of the delete ...
    • How-To: Determine which program is using a given port

      To discover which program is using a given IP address and port number on the computer click on the Start button in Windows and type 'CMD' when the CMD icon appears in the list, right-click on the icon and Run As Administrator in the command prompt ...
    • Video: Flag on Server Start Event

      View our video tutorial on setting up an event which sends an email (flag) to the administrator in response to a user action. This is an introductory event to help you familiarize yourself with the event handling features of Titan/Cornerstone. The ...