Tools
System Variables in Serv-U
This article lists the system variables used for the Serv-U server
First published date
Last published date
Overview
Certain configurable messages in Serv-U can be customized to include a wide range of variables as outlined in the list below. These variables are replaced at run-time with the appropriate value allowing up-to-date statistics and feedback to be provided to logged in Users. Some of the places where these variables can be used include in Event messages, a customized FTP command response, or a Welcome Message.
All available variables and a short explanation of each is included at the end of this article. During the process of creating a user, the Home Directory needs to be specified.
The variable %HOME% can be used instead of retyping C:\FTP\Data\Variableuser again when the Directory Access Rule is created.
Product section
Resolution
Server Information
- $ServerName - The full name of the server, (i.e., Serv-U)
- $ServerVersionShort - The first two digits of the current version of the Serv-U File Server, (e.g., 7.0)
- $ServerVersionLong - The full version number of the Serv-U File Server, (e.g., 7.0.0.3)
- $OS - The name of the operating system, (e.g., Windows XP)
- $OSVer - The full version number of the operating system, (e.g., 5.1.2600)
- $OSAndPlatform - The name of the operating system, (e.g., Windows XP) and platform (e.g., 32-bit or 64-bit)
- $ComputerName - The name of the computer retrieved from the operating system, normally the same as the UNC name on a Windows network (e.g., WEB-SERVER-01)
- $LogFilePath - Retrieves the path to the log file (Log File Deleted Event only)
Server Statistics
- $ServerDays - The total number of days the Server has been online continuously
- $ServerHours - The number of hours from 0 to 24 the Server has been online, carries over to $ServerDays
- $ServerMins - The number of minutes from 0 to 60 the Server has been online, carries over to $ServerHours
- $ServerSecs - The number of seconds from 0 to 60 the Server has been online, carries over to $ServerMins
- $ServerKBup - The total number of kilobytes uploaded
- $ServerKBdown - The total number of kilobytes downloaded
- $ServerFilesUp - The total number of files uploaded
- $ServerFilesDown - The total number of files downloaded
- $ServerFilesTot - The total number of files transferred, essentially ($ServerFilesUp + $ServerFilesDown)
- $LoggedInAll - The total number of established sessions
- $ServerUploadAvgKBps - The average upload rate in KB/s
- $ServerDownloadAvgKBps - The average download rate in KB/s
- $ServerAvg - The average data transfer rate (uploads and downloads) in KB/s
- $ServerUploadKBps - The current upload transfer rate in KB/s
- $ServerDownloadKBps - The current download transfer rate in KB/s
- $ServerKBps - The current aggregate data transfer rate in KB/s
- $ServerSessions24HPlusOne - The total number of sessions in the past 24 hours plus one additional session
- $ServerSessions24H - The total number of sessions in the past 24 hours
Domain Statistics
- $DomainKBup - The total number of kilobytes uploaded
- $DomainKBdown - The total number of kilobytes downloaded
- $DomainFilesUp - The total number of files uploaded
- $DomainFilesDown - The total number of files downloaded
- $DomainFilesTot - The total number of files transferred, essentially ($DomainFilesUp + $DomainFilesDown)
- $DomainLoggedIn - The total number of sessions currently connected
- $DomainUploadAvgKBps - The average upload rate in KB/s
- $DomainDownloadAvgKBps - The average download rate in KB/s
- $DomainAvg - The average aggregate data transfer rate (uploads and downloads) in KB/s
- $DomainUploadKBps - The current upload transfer rate in KB/s
- $DomainDownloadKBps - The current download transfer rate in KB/s
- $DomainKBps - The current aggregate data transfer rate in KB/s
- $DomainSessions24HPlusOne - The total number of sessions in the past 24 hours plus one additional session
- $DomainSessions24H - The total number of sessions in the past 24 hours
User Statistics - Applies to all sessions attached to the User account
- $UserKBUp - The total number of kilobytes uploaded
- $UserKBDown - The total number of kilobytes downloaded
- $UserKBTot - The total amount of kilobytes transferred
- $UserLoggedIn - The total number of sessions
- $UserUploadAvgKBps - The average upload rate in KB/s
- $UserDownloadAvgKBps - The average download rate in KB/s
- $UserAvg - The average aggregate data transfer rate (uploads and downloads) in KB/s
- $UserUploadKBps - The current upload transfer rate in KB/s
- $UserDownloadKBps - The current download transfer rate in KB/s
- $UserKBps - The current aggregate data transfer rate in KB/s
- $UserSessions24HPlusOne - The total number of sessions in the past 24 hours plus one additional session
- $UserSessions24H - The total number of sessions in the past 24 hours
Last Transfer Statistics - Applies to the most recently completed successful data transfer
- $TransferBytesPerSecond - The effective (compressed) transfer rate in bytes/s
- $TransferKBPerSecond - The effective (compressed) transfer rate in KB/s
- $TransferBytes - The effective (compressed) number of bytes transferred, formatted for display, e.g., 32,164
- $NoFormatTransferBytes - The effective (compressed) number of bytes transferred, unformatted, e.g., 32164
- $TransferKB - The effective (compressed) number of kilobytes transferred, formatted for display
- $ActualTransferBytesPerSecond - The actual (uncompressed) transfer rate in bytes/s
- $ActualTransferKBPerSecond - The actual (uncompressed) transfer rate in KB/s
- $ActualTransferBytes - The actual (uncompressed) number of bytes transferred, formatted for display, e.g., 32,164
- $NoFormatActualTransferBytes - The actual (uncompressed) number of bytes transferred, unformatted, e.g. 32164
- $ActualTransferKB - The actual (uncompressed) number of kilobytes transferred, formatted for display
- $CompressionRatio - The ratio of compression for the transfers expressed as a percentage of the expected amount of data is transferred. For example, a value of 100.00 means the data could not be compressed. A value of 200.00 means the data is compressed to half its original size.
- $CurrentCompressedTransferBytes - The current effective (compressed) number of bytes transferred so far, unformatted, e.g., 32164 (FTP only)
- $CurrentUncompressedTransferBytes - The current actual (uncompressed) number of bytes transferred so far, unformatted, e.g. 32164 (FTP only)
Date/Time
- $Date - The current date according to the Serv-U File Server, in the system's local date format
- $Time - The current time according to the Serv-U File Server, in the system's local time format
Server Settings
- $MaxUsers - The maximum number of sessions allowed to log in, which could be limited by the license
- $MaxAnonymous - The maximum number of anonymous users allowed to log in
Session Information - Applies to the current session
- $Name - The login ID of the attached User account
- $LoginID - The session's login ID, operates like $Name. $Name can refer to the login ID for target user accounts but $LoginID refers only to the login ID of the session.
- $IP - The client IP address
- $IPName - The reverse DNS name as obtained by performing a reverse DNS lookup on $IP
- $Dir - The session's current directory
- $Disk - The local drive letter being accessed
- $DFree - The amount of free space on $Disk in MB
- $FUp - The total number of files uploaded
- $FDown - The total number of files downloaded
- $FTot - The total number of files transferred, essentially ($FUp + $FDown)
- $BUp - The total number of kilobytes uploaded
- $Bdown - The total number of kilobytes downloaded
- $BTot - The total number of kilobytes transferred
- $TConM - The total number of minutes the session has been connected
- $TConS - The number of seconds from 0 to 60 that the session has been connected, carries over to $TconM
- $RatioUp - The 'upload' portion of the applied ratio, "N/A" if not in use
- $RatioDown - The 'download' portion of the applied ratio, "N/A" if not in use
- $RatioType - The type of ratio being applied, either per session or per User
- $RatioCreditType - The type of ratio credit granted for transfers, either per bytes or per complete file
- $RatioCredit - The current transfer credit for the applied ratio, either megabytes or complete files
- $QuotaUsed - Displays how much disk quota is currently being used in MB, "Unlimited" if no quota is in use
- $QuotaLeft - Displays how much disk quota is available in MB, "Unlimited" if no quota is in use
- $QuotaMax - Displays the maximum amount of disk space that can be used in MB, "Unlimited" if no quota is in use
- $Protocol - The current protocol being used (FTP, FTPS, HTTP, HTTPS, or SFTP (SSH2))
- $DomainName - The current domain that the session is logged into
- $DomainDescription - The description of the current domain that the session is logged into
- $TimeRemaining - The time remaining when blocking an IP address for an amount of time (available only in Event notifications)
- $LocalHomeDirectory - The local home directory. It should only be used for events that need this specific information such as user creation.
- $Password - The password associated with the user account. It is intended only for events. It should NOT be used for welcome messages.
- $UserEmailAddress - The user's email address.
- $FullName - The user's full name as entered into the "Full Name" field for a user account.
- $SpaceFullName - The same as "$FullName" with the addition of a space before the user's full name. Blank (no space or name) when the user's full name is empty.
- $FullNameSpace - The same as "$FullName" with the addition of a space after the user's full name. Blank (no space or name) when the user's full name is empty.
- NOTE: Using the $IPName variable inside of an event or sign-on message can cause a slight delay while the reverse DNS information for $IP is retrieved.
File Information - Applies to the last remotely accessed file, which is not necessarily the last transferred file
- $PathName - Retrieves the full remote path
- $FileName - Retrieves just the filename from $PathName
- $FileSize - Retrieves the size, in bytes, of the file from $FileName
- $FileSizeFmt - A formatted version of the file size, containing the thousands separator (comma or period depending on the computer's regional settings)
- $FileSizeKB - A formatted floating point value representing the file size in KB
- $LocalPathName - Retrieves the fully qualified local path name for an operation, as it relates to Windows. For example "C:\Temp\File.fid" instead of "/Temp/file.fid"
- $LocalFileName - Retrieves the name of the file as it is stored on the local computer. See $LocalPathName for details
- $OldLocalPathName - Same as $LocalPathName, but contains the path prior to renaming
- $OldLocalFileName - Same as $LocalFileName, but contains the file name prior to renaming
- $OldPathName - Retrieves the remote path name prior to renaming
- $OldFileName - Retrieves the remote file name prior to renaming
Current Activity
- $UNow - The current number of sessions on the Serv-U File Server
- $UAll - The total number of sessions that have connected to the Serv-U File Server since it was last started
- $U24h - The total number of sessions that have connected to the Serv-U File Server in the last 24 hours
- $UAnonAll - The current number of sessions attributed to the anonymous user on the Serv-U File Server
- $UAnonThisDomain - The current number of sessions attributed to the anonymous user on the connected Domain
- $UNonAnonAll - The current number of sessions not attributed to the anonymous user on the Serv-U File Server
- $UNonAnonThisDomain - The current number of sessions not attributed to the anonymous user on the connected Domain
- $UThisName - The current number of sessions attributed to the connected User account
FileShare
- $FileShareExpires - The link expiration date for the file
- $FullName - The Serv-U username of the user who shared the file
- $FileShareTokenURL - The fileshare URL
- $FileShareComments - An optional message