FileBack PC Variable Expansion
FileBack PC supports variable expansion, allowing a single
configuration file to be used on multiple computers, or with
multiple users, with different backup behavior based on who is
logged into a computer at any given time, by date or time, or by
other configurable parameters.
FileBack PC variables can be used in folder paths, network
paths, outgoing email and other alerts, file specifications,
file archive folder paths, folder exclusion lists, text
prompts, and other locations.
Inserting Variables
FileBack PC variables always follow the following convention:
{ (FB$variable name) }. A backup source path
including a variable might look like: C:\My Documents\{FB$username}\,
which would be expanded to C:\My Documents\jsmith\ for example.
Variables can either be typed manually, or be inserted by
FileBack PC. To have FileBack PC insert a variable, place the
insertion point (cursor) where the variable should be added,
click the notepad icon next to the data entry field, and pick
the variable from the popup list.
Using Variables in Network and Folder paths
Network / Folder
Path |
Variable Name(s) |
Variable Value |
Expanded Name |
\\server1\drive\{FB$usershare} |
{FB$usershare} |
Jim Smith |
\\server1\drive\Jim
Smith |
\\{FB$backupserver}\backups\{FB$username} |
{FB$backupserver}
{FB$username} |
isbackup
jsmith |
\\isbackup\backups\jsmith |
C:\Backups\{FB$docbackups} |
{FB$docbackups} |
jsmithdocs |
C:\Backups\jsmithdocs |
{FB$backupdrive}\Backups |
{FB$backupdrive} |
C: |
C:\Backups |
{FB$temp} |
{FB$temp} |
C:\Windows\Temp |
C:\Windows\Temp |
Network Paths
Including a variable in a network path is simply a matter of
including the variable name, within braces, in the network path,
when mapping a network drive from within the Backup Job Editor
in FileBack PC.
Folder Paths
Variables can be typed directly into the space provided for
editing the source and destination backup paths. System
information variables that reference folders on your computer
are automatically appended with a trailing backslash (\) if
necessary.
Pre-defined variables
A number of variables have been pre-defined within FileBack
PC:
System Information Variables
Variable Name |
Description |
{FB$username} |
Name
of user logged into Windows |
{FB$temp} |
Windows temp folder |
{FB$windows} |
Windows folder |
{FB$system} |
Windows System folder |
{FB$SYSTEMDRIVE} |
Drive
letter of Windows folder |
{FB$PROGRAMFILES} |
Location of 'Program Files' folder |
{FB$computername} |
Windows computer name |
{FB$fbprogdir} |
FileBack PC program folder (currently running
installation) |
{FB$fbinstalldir} |
Initial FileBack PC installation folder |
{FB$fbversion} |
Current FileBack PC Version |
{FB$configfile} |
Current FileBack PC configuration file |
{FB$fblogfile} |
Filename of current FileBack PC log file (today's) |
{FB$env$environmentvar} |
Value
of system environment variable
environmentvar
Example: {FB$env$windir} |
{FB$file$filename} |
Contents of file filename
Example: {FB$file$c:\bootlog.txt} |
{FB$mydocuments} or
{FB$mydocs} |
Location of the user's My Documents folder |
{FB$applicationdata} or {FB$appdata} |
Location of the user's Application Data folder |
{FB$cookies} |
Location of the user's Internet Explorer Cookies
folder |
{FB$desktop} |
Location of the user's desktop folder |
{FB$favorites} |
Location of the user's Internet Explorer favorites
folder |
{FB$xpcdburning} |
Location of the user's XP CD burning staging folder |
{FB$mymusic} |
Location of the user's My Music folder |
{FB$mypictures} |
Location of the user's My Pictures folder |
{FB$myvideo} |
Location of the user's My Video folder |
{FB$USERPROFILE} |
Location of the user's profile folder |
{FB$HOMEDRIVE} |
Drive
letter of user's home folder |
{FB$HOMEPATH} |
Full
path name of user's home folder |
{FB$HOMESHARE} |
Share
name of user's home folder |
{FB$LOGONSERVER} |
Name
of server user is logged on to |
{FB$USERDOMAIN} |
Name
of domain user is logged on to |
{FB$shellcommonfolder$(name)} |
(Advanced users only) Location of a particular
common folder |
{FB$commondocuments} or {FB$commondocs} |
Location of the common My Documents folder |
{FB$commonapplicationdata} or {FB$commonappdata} |
Location of the common Application Data folder |
{FB$commondesktop} |
Location of the common Desktop folder |
{FB$commonfavorites} |
Location of the common Internet Explorer favorites
folder |
{FB$commontemplates} |
Location of the common Templates folder |
{FB$commonpictures} |
Location of the common My Pictures folder |
{FB$commonmusic} |
Location of the common My Music folder |
{FB$commonvideo} |
Location of the common My VIdeo folder |
{FB$ALLUSERSPROFILE} |
Location of 'All Users' profile folder |
{FB$temp} |
Location of the user's Temporary folder |
{FB$fbconfigfile} |
Current configuration (.FBCfg) file |
{FB$fblogfile} |
Current log file (today's data only) |
{FB$fbversion} |
Current FileBack PC version string |
{FB$finddrive$(serial
number)} |
Drive
letter with specific serial number (x:\) |
{FB$hklm$(key\value)}
{FB$hkcu$(key\value)}
{FB$hkcc$(key\value)}
{FB$hku$(key\value)} |
Reads
a value from the system registry hive:
HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER,
HKEY_CURRENT_CONFIG, or HKEY_USERS. |
Time and Date Variables
Variable Name |
Description |
Versions |
{FB$date} |
Current system date (17-Sep-99 format) |
All 4.0 |
{FB$time} |
Time
of day (1:23p format) |
All 4.0 |
{FB$month} |
Name
of month (Jan, Feb, etc) |
All 4.0 |
{FB$month1} |
Numeric month (1, 2, etc.) |
All 4.0 |
{FB$month2} |
Two-digit numeric month (01, 02, etc.) |
All 4.0 |
{FB$day}, {FB$day1} |
Numeric day of month (1, 2, etc.) |
All 4.0 |
{FB$day2} |
Two-digit numeric day of month (01, 02, etc.) |
All 4.0 |
{FB$dayofweek} |
Day
of week (Sunday, Monday, etc.) |
All 4.0 |
{FB$dayofweek3} |
Three-character day of week (Sun, Mon, etc.) |
All 4.0 |
{FB$dayofweek2} |
Two-character day of week (Su, Mo, etc.) |
All 4.0 |
{FB$year}, {FB$year4} |
Four-digit numeric year (1999, 2000, etc.) |
All 4.0 |
{FB$year2} |
Two-digit numeric year (99, 00, etc.) |
All 4.0 |
{FB$hour1} |
Current hour, 24-hour format (1, 2, etc.) |
All 4.0 |
{FB$hour2} |
Two-digit current hour, 24-hour format (01, 02,
etc.) |
All 4.0 |
{FB$minute},
{FB$minute1} |
Current minute (1, 2, etc.) |
All 4.0 |
{FB$minute2} |
Two-digit current minute (01, 02, etc.) |
All 4.0 |
{FB$second},
{FB$second1} |
Current second (1, 2, etc.) |
All 4.0 |
{FB$second2} |
Two-digit current second (01, 02, etc.) |
All 4.0 |
{FB$dateval} |
Date
serial value, calculated as the number of days (and
fractions thereof) since 1/1/1900. |
All 4.0 |
{FB$fulldate} |
Full
date, in mm-ddd-yyyy hh:nn:ss format |
All 4.0 |
Date and time variables can also have offsets added to or
subtracted from them. For example, {FB$DATE-4} is replaced
with the date 4 days ago, or {FB$DATE+0.5} is replaced with the
date 1/2 day (12 hours) in the future.
Backup Information Variables
Variable Name |
Description |
Versions |
{FB$descr} |
Description text from last operation:
For backup entries, the backup job description.
For backup groups, the group name.
For scheduled events, the type of event |
All 4.0 |
{FB$sourcedir} |
Source folder of last backup job |
All 4.0 |
{FB$destdir} |
Destination folder of last backup job |
All 4.0 |
{FB$sourcedrive} |
Backup source drive letter (D:) |
All 4.0 |
{FB$destdrive} |
Backup destination drive letter (E:) |
All 4.0 |
{FB$sourceshare} |
Network share name of backup source (computer/share
only) |
09-Mar-2005+ |
{FB$destshare} |
Network share name of backup destination |
09-Mar-2005+ |
{FB$netsourcepath} |
Source folder of backup job, network share included |
09-Mar-2005+ |
{FB$netdestpath} |
Destination folder of backup job, network share
included |
09-Mar-2005+ |
{FB$backupid} |
Unique 8-digit hexadecimal backup ID number |
All 4.0 |
{FB$group} |
Current backup group |
All 4.0 |
{FB$trigger} |
Trigger which initiated the current backup operation |
09-May-2005+ |
{FB$elapsedtime} |
Elapsed time of last backup / scheduled event (h:mm:ss
format) |
All 4.0 |
{FB$lasterrornum} |
Error
code of last backup error |
All 4.0 |
{FB$lasterror} |
Description of last backup error |
All 4.0 |
{FB$copycount} |
Number of files copied in last backup operation |
All 4.0 |
{FB$comparecount} |
Number of files compared in last backup operation |
All 4.0 |
{FB$errorcount} |
Number of errors in last backup operation |
All 4.0 |
{FB$resetcopy} |
Number of files copied since last access of "resetcopy"
variable value.
Each time this variable is accessed its contents are
reset to zero. |
All 4.0 |
{FB$resetcompare} |
Number of files compared since last access of "resetcompare"
variable value.
Each time this variable is accessed its contents are
reset to zero. |
All 4.0 |
{FB$reseterrors} |
Number of errors since last access of "reseterrors"
variable value.
Each time this variable is accessed its contents are
reset to zero. |
All 4.0 |
{FB$log} |
Include all entries added to the log in the current
backup job / group / scheduled event |
All 4.0 |
{FB$log${entry
types}} |
Include specific entries added to the log in the
current backup job / group / scheduled event.
"Entry types" is a list of letters representing the
types of entries to include according to the
following list:
B=Start / Completion of Backup
N=Start / Completion of Backup Job
F=New Folder
C=Files Backed Up
Y=Files Synchronized
D=Files Deleted
A=Files Archived
I=General Information
T=Backup Statistics
W=Warnings
E=Errors
V=Start of Scheduled Event
Example: {FB$log$BFCYITWEV} |
All 4.0 |
{FB$copiedfiles} |
Comma-delimited list of files backed up or
synchronized during the last backup operation |
Jan 20, 2005+ |
{FB$copiedfiles${fields}} |
Include specific fields in copied file listing,
according to the following list:
T = Date and time of file copy
S = Source folder file was copied from
D = Destination folder where file was copied to
f = Filename only (no path) of file that was
copied
F = Filename (with path) of file that was copied
Z = Size of copied file
R = Reason file was copied
Example: {FB$copiedfiles$TFZ} |
Jan 20, 2005+ |
{FB$deletedfiles} |
Comma-delimited list of files deleted or
archived during the last backup operation |
May 9, 2005+ |
{FB$deletedfiles${fields}} |
Include specific fields in deleted file listing,
according to the following list:
T = Date and time of file
delete
S = Folder file was deleted from
f = Filename only (no path) of file that was
deleted
F = Filename (with path) of file that was
deleted
Z = Size of deleted file
R = Reason file was deleted
Example: {FB$deletedfiles$TFZ} |
May 9, 2005+ |
User Variables - System Registry
FileBack PC user variables are stored as string values in the
system registry. The following keys are used:
HKEY_LOCAL_MACHINE\Software\Maximum
Output Software\FileBack PC\4.0\Variables
HKEY_CURRENT_USER\Software\Maximum
Output Software\FileBack PC\4.0\Variables
When expanding variables, FileBack first searches
HKEY_CURRENT_USER. If it finds a value for the requested
variable, that value is substituted and the backup process
continues. If no entry is found in HKEY_CURRENT_USER,
HKEY_LOCAL_MACHINE is searched as well.
All variables should be stored using the REG_SZ data type.
Note:
Variable names in the registry SHOULD include the FB$
prefix. The prefix is NOT added automatically
by FileBack PC. |
User Variables - Lookup in .VAR files
Any text file with a .VAR extension in the FileBack PC
program folder are automatically loaded and searched for
variable contents. The format of the data within these files is
NAME=CONTENTS on individual lines within the file. Variables
found in .VAR files override all other variables, including
those built into FileBack PC.
Note:
Variable names in .VAR files should NOT include the
FB$ prefix. The prefix is added automatically by
FileBack PC. |
Undefined Variables
If a variable is not found, the user is alerted that the
variable could not be found, and is prompted to enter a value
for the variable. He/she is then prompted whether to save the
contents of the variable for all users, for just him/herself, or
to not save the contents for future recall. If you do not
wish for the user to be prompted for a value, either use the {FB$DEFAULT$name,value}
or {FB$NOPROMPT$name} format.
Default Values
There are two additional options for the way FileBack PC
handles unknown variables. Placing a NOPROMPT$ in front of the
variable name ({FB$NOPROMPT$USERFOLDER} for example) prevents
the 'variable does not exist' prompt from appearing and uses an
empty value as the default. Placing DEFAULT$ in front of the
variable allows a default value to be specified: {FB$DEFAULT$USERFOLDER,C:\UserDocs}
will return C:\UserDocs if the USERFOLDER variable does not
exist.
Nested Variables
FileBack PC also supports nested variables, meaning that you
can include the name of one variable within another. For
example, you could include the contents of a file (FB$file$xxx)
whose name is stored in another variable (FB$fblogfile): {FB$file${FB$fblogfile}}
Variables in Restoration/Cleanup Procedures
FileBack PC 4.0 keeps a list of folders that have been used
for storing backups and automatically scans all of these folders
which are available when the restoration or cleanup is
performed. Including a variable in a backup folder path
will make the restoration and cleanup procedures take longer if
variables are used in the destination folder path and the
contents of the variable change with time.
FileBack PC uses certain variables internally, and its
behavior can be changed by modifying the values of these
variables:
Variable Name |
Use |
Example Contents |
{FB$globalexclude} |
Add entries to folder exclusion
list of all backup entries |
C:\Windows\Temp |
{FB$userexclude} |
Add entries to folder exclusion
list of all backup entries |
C:\Windows\Temp |
{FB$prefilespec} |
File specification to add to the
beginning of all backup job file specifications |
!*.tmp |
{FB$postfilespec} |
File specification to add to the
end of all backup job file specifications |
!*.tmp |
You will not see these variables or their contents in the
edit fields for the folder exclusion list or the file
specification list. They are added at the time a backup job is
run instead. These variables can be used to globally exclude a
folder or files from all backup entries, or even include files
in all backup jobs.
Both the PREFILESPEC and POSTFILESPEC variables are provided
because the file specification line is processed from left to
right, with specifications further to the right taking
precedence over those on the left. The PREFILESPEC
specification can be overridden by either the backup job file
specification or the POSTFILESPEC variable, while the
POSTFILESPEC variable cannot be overridden at all. |