Macro Strings

 Content Previous Next

Topic Content

Macro Assistant

Universal Macros

Macros That Can be Used Within Backup Step Only

Macros That Can be Used After Backup, Two-Way Sync, Monitoring, or Clean-up Step

 

 

This sections explains how to use AnyFileBackup macro strings. Each macro starts with a dollar sign followed by a left curly bracket (${). Then you type a macro string. Each macro must end with a right curly bracket (})

 

 

Macro Assistant

Macro Assistant is designed to help you to access the most common macro strings without looking into the help documentation. It can be accessed by clicking on the button with '< >' icon (see the screenshot below) from the Task Properties window.

 

Each macro string has at between one and values. The first value is always mandatory (without it macro will not be recognised) and any others (if any) are optional.

 

To select a macro, left-click on the macro name in the table. To select any of its values, left-click on the respective value available for that macro. To select another value, left-click on it. It is important to left-click on the value itself, not anywhere else.

 

When you click the 'OK' button, the string that you have selected (macro and its value(s)) will be automatically copied to clipboard. You may insert it by pressing 'Ctrl-V' key sequence or by mouse right-click and then select 'Paste'

Macro assistant

 

 

 

Universal Macros

These macros may be used almost universally, with any action or source, at any point of task scenario.

AnyFileBackup full edition name

${AFBNAME}

AnyFileBackup installed version

${AFBVER}

Current date

${DATE}

Current date format

${DATE=[DATE FORMAT]}

 

Example: ${DATE=yyyy-mm-dd}

Current time

${TIME}

Current time in specified format

${TIME=[TIME FORMAT]}

 

Example: ${TIME=hh:nn:ss}

E-mail attachment

${ATTACHMENT,FILE=[PATH TO FILE]}

 

Example: ${ATTACHMENT,FILE=C:Readme.txt}

Environment variable

${ENVGET=[ENVIRONMENT VARIABLE VALUE]}

 

Read also about environment variables values.

Load text from file

${EXTTEXT,FILE="[PATH TO FILE]",[KEYS]}

 

FILE="[PATH TO FILE]" a full path in double quotes ("") to a file (usually a plain text file) which contains text to be included into a message body.

 

[KEYS] are additional optional parameters separated by a comma (',') without space:

 

CR=[CHARACTER CODE] (specifies a code of character which should replace CR (cartridge return) code in the loaded text. Example: CR=32 (CR will be replaced with space).

 

LF=[CHARACTER CODE] (specifies a code of character which should replace LF (line feed) code in the loaded text. Example: LF=124 (LF will be replaced with "|", a vertical line)

 

To find character codes (in decimal) search Google for "character codes decimal" or for "ASCII table".

Location of Source

${SOURCEPATH}

Log file message

${LOGMSG}

 

A custom text message that is written into AnyFileBackup log file (distinguish it from AnyFileBackup Event List).

Name of the current task

${TASKNAME}

Name of the group task belongs to

${GROUPNAME}

Reporting extension macro

There are few macros that are only used with the Report Manager. You can read about them in the dedicated section of this help.

 

 

Macros That Can be Used Within Backup Step Only

These macros may be used ONLY within the Backup step of the Task Scenario.

Amazon S3 URL to an uploaded file

${AMAZON-S3-FILEURL}

Conflict resolution rules only macro

These macro strings are only available when BACKUP > Conflict Resolution Rules are configured to rename files with identical names.

 

The following macros are available:

 

${FULLNAME}: a full file name including its extension

 

${FILENAME}: a full file name excluding its extension

 

${FILEEXT}: a file's extension

 

${NUM}: a file's index number which is automatically assigned to it and which automatically increased by one with every file renamed.

E-mail sender address

${FROM}

 

Where Source is a mailbox: an e-mail address of the sender from the received e-mail message

E-mail recipient address

${TO}

 

Where Source is a mailbox: an e-mail address of the receipient from the received e-mail message

E-mail subject

${SUBJECT}

 

Where Source is a mailbox: subject from the received e-mail message

E-mail ID

${MESSAGEID}

 

Where Source is a mailbox: e-mail message identification number from the received e-mail message

File name and its parameters

${FILE[,KEYS]}

 

[KEYS] are additional optional parameters separated by comma (',') without space:

 

PATH (to include file path).

 

Example: ${FILE,PATH}.

File size in specified units

${FILESIZE=[B,K,M]} where B=bytes, K=kilobytes, and M=megabytes. If no value is entered, a default value is =B.

 

Example: ${FILESIZE=M}

File timestamp in specified format

${FILETIME=[TIMESTAMP FORMAT]}

 

If no value is entered, a default value is a format set in AnyFileBackup 'Program Settings' > 'Common' > 'Appearance'.

 

Example: ${FILETIME=yy-mm-dd hh:nn:ss} will look like 14-07-25 13:10:55

Target file

${TARGETFILE}

 

This macro is replaced with a full path and filename of a file that has been backed up to Target. If this files has been renamed in a course of the backup, then the macro will use the renamed file.

 

 

Macros That Can be Used After Backup, Two-Way Sync, Monitoring, or Clean-up Step

These macros may be used ONLY when the Backup, Two-Way Sync, Monitoring, or Clean-up step of the Task Scenario has been completed.

Amazon S3 URL list to all uploaded files

${AMAZON-S3-URLS}

Disk space: free or occupied

${DISKSPACE}

 

Disk space monitoring only

E-mail sender address

${FROM}

 

Where Source is mailbox: an e-mail address of the sender from the received e-mail message

E-mail recipient address

${TO}

 

Where Source is mailbox: an e-mail address of the receipient from the received e-mail message

E-mail subject

${SUBJECT}

 

Where Source is a mailbox: subject from the received e-mail message

E-mail ID

${MESSAGEID}

 

Where Source is a mailbox: e-mail message identification number from the received e-mail message

Event log: event ID

${EVENTLOG-EVENTID}

 

Where Source is Windows Event Log: Event ID of a new event log record that was detected by AnyFileBackup when it monitors Windows Event Log (Event Log extension is required)

Event log: event level

${EVENTLOG-EVENTLEVEL}

 

Where Source is Windows Event Log: Event Level of a new event log record that was detected by AnyFileBackup when it monitors Windows Event Log (Event Log extension is required)

Event log: event source

${EVENTLOG-EVENTSOURCE}

 

Where Source is Windows Event Log: Event Source of a new event log record that was detected by AnyFileBackup when it monitors Windows Event Log (Event Log extension is required)

Event log event text

${EVENTLOGMSG}

 

Where Source is Windows Event Log: text of a new event log record that was detected by AnyFileBackup when it monitors Windows Event Log (Event Log extension is required)

File counter (for files transferred)

${FILESCOUNT[,KEYS]}

 

Only works with Source that has files (that means that it does not work with PING monitoring, HDD space monitoring, etc.)

 

[KEYS] are additional optional parameters separated by commas (',') without space:

 

FILTER=NEW (only created and changed files are included in a total files count), =DEL (only deleted files are included in a total files count). Default value is =NEW.

 

DIR=Y (this will count directories alongside with files and include them [directories] in a total files count), =N (directories are not counted and not included in a total files count). If no value is entered, a default value is =N.
File list (for files transferred)

${FILELIST[,KEYS]}

 

Where Source has files that means that it does not apply to PING monitoring, HDD space monitoring, etc..

 

[KEYS] are additional optional parameters separated by comma (',') without space:

 

PATH (to include file path).

 

"DL=[CHARACTER]" a separator between files in the file list. The separator can consist of one or more characters. This key must be put in double quotes (""). If no value is entered, a default value is LF (line feed).

 

FILTER=NEW (only created (aka 'new') and changed files are included in a total files count), =DEL (only deleted files are included in a total files count). Default value is =NEW.

 

Example: ${FILELIST,PATH,"DL=;",FILTER=NEW} means that created and changed files with their full paths separated by a semicolon (";") are included in the file list.

 Content Previous Next