Server variables#
In many text fields of the server, a name in braces is replaced by a value at the moment the text is used: {username} becomes the name of the user, {hostname} the name of the machine. They work in welcome messages, in the texts of mails and alerts, in paths of settings, in the events of a user.
This page lists the variables the server itself knows. The variables of jobs and tasks, which are more, are in Task variables.
Writing a variable#
{name}, in braces. The older form with percent signs, %name%, means the same and still works; some of the server's own starting texts use it.
A name the server does not know is left as it stands.
The user#
Every field of the user can be used, with user_ before its key: {user_email}, {user_first_name}, {user_notes}. The keys are listed in Every user field.
The ones used most:
| Variable | Is |
|---|---|
{username}, {user_name} |
the login name |
{user_email}, {user_first_name}, {user_last_name} |
from the user's settings |
{user_ip} |
the address they connected from |
{user_protocol} |
FTP, SFTP, HTTPS and so on |
{user_port}, {user_listen_ip}, {user_listen_ip_port} |
the port and address of the server they came in on, and the connection group |
{user_id}, {user_sessionid} |
the ids of the session |
{user_login_date}, {user_login_date_formatted}, {user_time} |
when they logged in |
{user_current_dir}, {user_dir} |
the folder they are in, with and without the name of their top folder |
{user_the_command}, {user_the_command_data} |
the command they just gave, and what it was given |
{user_last_file_name}, {user_last_file_real_path} |
the last file they transferred |
{user_session_upload_count}, {user_session_download_count} |
files up and down in this session |
{user_bytes_sent}, {user_bytes_received} |
bytes in this session |
{user_overall_transfer_speed}, {user_current_transfer_speed} |
the speed of the transfer |
{user_time_remaining}, {user_bytes_remaining} |
what a time or amount limit leaves |
{user_ratio}, {user_perm_ratio} |
the user's ratio |
{user_password} |
the password the user typed at this login. See the warning below. |
A user who came from a directory also has the directory's attributes: {user_ldap_mail}, {user_ldap_sAMAccountName}, and so on for each attribute, with user_ldap_ before its name.
| Variable | Is |
|---|---|
{group0}, {group1}, … and {0group}, {1group}, … |
the users this user inherits from, in order |
{admin_user_…} |
a field of the administrator who is acting, with its key after the underscore |
Warning
{user_password} puts a password into whatever text it is in: a mail, a log, a file. It is there for the mail that tells a new user their first password. Use it nowhere else, and prefer a link for setting a password over a password in a mail.
The server#
| Variable | Is |
|---|---|
{hostname} |
the name of the machine |
{ip} |
the server's address |
{server_time_date} |
now |
{start_time} |
when the server started |
{version_info}, {about_info}, {about_info_str} |
the version, and the line the About section shows |
{working_dir} |
the server's folder |
{users_connected}, {max_users} |
users connected now, and the most allowed |
{login_number} |
the count of logins since the start |
{total_logins}, {successful_logins}, {failed_logins} |
counts of logins |
{last_login_user}, {last_login_ip}, {last_login_date_time} |
the latest login |
{downloaded_files}, {uploaded_files} |
counts of files |
{bytes_received}, {bytes_sent}, {total_bytes} |
bytes, as numbers. With _f at the end, as "1.2 GB". |
{current_download_speed}, {current_upload_speed} |
the server's speed now |
{current_server_downloading_count}, {current_server_uploading_count} |
transfers running now |
{max_server_download_speed}, {max_server_upload_speed} |
the server's speed limits |
{thread_count}, {free_memory} |
threads, and free memory |
{thread_dump} |
a thread dump, taken at that moment. The memory alert's mail uses it. |
{global_…} |
a value you stored yourself, by its name: see Variables of your own |
{customData_…} |
a value from the server's custom data, by its name |
More of the server's live values, the ones the Dashboard shows, can be read by the variable watcher, which lists them.
In the events of a user#
An event that fires for files has, for each file, the variables of the file. In a mail's body, what stands between {line_start} and {line_end} is repeated for every file of the event.
| Variable | Is |
|---|---|
{name}, {path}, {url} |
the file's name, its folder, and its full address |
{size}, {size_formatted} |
the size in bytes, and as "1.2 MB" |
{start}, {end} |
when the transfer began and ended |
{error} |
empty, or what went wrong. An event also fires for a transfer that failed. |
{path1}, {path2}, … |
the parts of the path, counted from the right |
{1path}, {2path}, … |
the parts of the path, counted from the left |
{url1}, {1url}, … |
the same for the address |
{all} |
everything the event knows about the file, as it is. For finding out what there is. |
{meta_…} |
an answer from an upload form, by the form field's name |
See The event editor.
Characters that an address cannot hold#
Where a setting holds an address with a login in it, some characters of a password would be read as part of the address. These stand for them. The Browse windows write them for you.
| Write | For |
|---|---|
{at} |
@ |
{colon} |
: |
{slash}, {backslash} |
/, \ |
{question}, {amp}, {hash}, {percent} |
?, &, #, % |
{plus}, {pipe} |
+, | |
{quote}, {apos} |
", ' |
{leftbracket}, {rightbracket} |
[, ] |
Things to know#
- A variable is filled in when the text is used, not when you save it.
- Not every variable has a value everywhere. A text that is used outside a session, such as a server-wide alert, has no user.
- A value is text, never a command. What a user typed cannot become a variable that is then filled in again.
- Dates in more forms, and arithmetic on values, are the business of jobs: Variables, Functions.
Where this list comes from#
The names are read from the place in the server's code that fills them in, and from the earlier documentation's list. They were not each tried.