Command line reference
 
Command line reference
Note  The following information is for server administrators.
FileMaker provides the tool fmsadmin for administering FileMaker Server via the command line interface (CLI). You must be logged on to the computer running FileMaker Server, either directly or using remote desktop software, to use the CLI.
Note  The CLI is available via the command prompt (Windows) and the Terminal application (OS X).
Command Line Interface files
The CLI executable fmsadmin is located in the folder:
Windows: [drive]:\Program Files\FileMaker\FileMaker Server\Database Server\fmsadmin.exe
OS X: /Library/FileMaker Server/Database Server/bin/fmsadmin
Notes
Windows: If FileMaker Server is installed in a non-default location, the beginning portion of the default path shown above, \Program Files\FileMaker\FileMaker Server, is replaced with the path that was specified during installation. For example: \My_Path\Database Server\
OS X: The following symbolic link to fmsadmin is also installed: /usr/bin/fmsadmin
Commands
The general format for fmsadmin commands is:
fmsadmin command [options]
The following example authenticates with Admin Console user name admin and the password pword and closes all open databases without prompting you to confirm:
fmsadmin close -y -u admin -p pword
Important  CLI commands can include the Admin Console name and password. If a command is used interactively, the user name is visible but the password is not. If a command in a script or batch file must include a name and password, be sure that only the password owner can view the script or batch file.
In the CLI, use the fmsadmin help command to see Help pages on other commands. For FileMaker Server online Help on specific commands, see fmsadmin commands.
Options
Options pass switches and parameters to fmsadmin. Type fmsadmin help options to see the list. You can specify options in a short or a long format, for example: -h or --help. You can use the following options with all commands.
 
Use
To
-h, --help
Print the CLI built-in help page.
-p password, --password password
Specify the password to use to authenticate the server. See OPEN command for information about password parameters for opening encrypted databases.
-u username, --username username
Specify username and/or domain name to use to connect to FileMaker Server.
-v, --version
Print version information.
-w seconds, --wait seconds
Specify time in seconds for command to time out.
-y, --yes
Automatically answer yes to all command prompts.
Options for specific commands
 
Use
To
-d path, --dest path
Specify a backup destination path.
-f, --force
Force close a database or shut down the server.
-k number, --keep number
Specify count of backups to keep.
--key encryptpass
Specify the database encryption password.
-m message, --message message
Specify a text message to be sent to clients.
-n, -- clone
Clone backup file.
-o, --offline
Perform an offline backup.
-s, --stats
Return file or client statistics.
--savekey
Save the database encryption password.
-t seconds, --gracetime seconds
Specify time in seconds before client is forced to quit.
-x, --verify
Verify integrity of backup file.
To specify the short form of options, use a single hyphen (-). You can specify multiple options together. If an option requires a parameter, that option is usually the last option that you specify. For example,
fmsadmin close -ym 'Closing for maintenance' Database.fmp12
To specify the long form of options, use double hyphens (--). Long options can be used in scripts to increase readability. You must specify each option separately, preceded by two hyphens. A space is required between the option and any parameters, for example,
fmsadmin close --yes --message "Closing for maintenance" Database.fmp12
Parameters
Enclose any parameters that contain spaces in single or double quotation marks.
Tip  For computer and filenames, use names consisting of standard ASCII characters without spaces.
You can specify file IDs instead of filenames. Use fmsadmin list files -s to return file IDs and other statistics. File IDs are dynamically generated.
Symbols that may be interpreted by the shell must be escaped, that is, preceded by a backslash character (\). Refer to the documentation for your shell or command interpreter.
Example: the following command does not prompt for confirmation (-y), allows clients 5 minutes to close the file (-t300), and sends a message (-m). The command operates on file IDs 20 and 22 and the folder “Solution”.
fmsadmin close -y -t300 -m "Closing for maintenance" 20 22 "filemac:/Library/FileMaker Server/Data/Databases/Solution/"
To specify a filename that consists of numbers, you must put the filename and its extension in quotation marks. For example:
"12345.fmp12"
Otherwise, the command line interface treats the string of numbers as a file ID instead of a filename.
Scripting language
If you use a scripting language that allows execution of shell or Terminal commands, you can script many tasks with fmsadmin. On OS X, you can use tools such as cron or launchd to schedule execution of fmsadmin commands like “run schedule” or “backup”. On Windows, you can use the Scheduled Task Wizard to schedule scripted tasks.
Administrator authentication
FileMaker Server challenges the CLI for authentication if you have not enabled Use external group on the General Settings > Admin Console tab. If you have enabled Use external group and you are currently logged in to the machine as a member of the external group, FileMaker Server does not challenge the CLI for authentication.
FileMaker Server logs all administrator connections, both successful or failed.
Related topics 
Command line error messages