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

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 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 and Cornerstone. They are not available in older versions of the software.



    • Related Articles

    • 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 ...
    • How To: Get the list of Variables

      How To: Get the list of Variables Question Where can I get the list of Variables Titan uses? Answer Below are the steps to get the list of Variables: Steps to get the list of available variables in Titan NexGen Go to Domain > Server Click ...
    • HowTo MoveFilesWithAnEventInTitanNexGen

      How To: Move Files with an Event in Titan NexGen Question How to move files using an event in Titan NexGen? Answer Please follow the step-by-step instructions below. Steps to Move Files using Event Upload Successful: In your Admin Console, go to ...
    • How To: Create a File Uploaded Event

      Question Can I create an automation that triggers once a file is uploaded into Titan SFTP Server? Reasoning As an admin, I would like to be able to create automations that perhaps can send email notifications or process the incoming files once ...
    • How To: Launch a Script with an Event

      Question Is it possible to have Titan SFTP Server launch a custom script from an event? Reasoning I have several actions needed to be performed which Titan does not have a native action for, therefore, I have written a script which will perform all ...