Selecting a system-level script to run
Note  The following information is for server administrators and group administrators.
See Running system-level script files.
Place system-level script files in the Scripts folder before starting the Schedule assistant:
Windows: [drive]:\Program Files\FileMaker\FileMaker Server\Data\Scripts\
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\Data\Scripts\
macOS: /Library/FileMaker Server/Data/Scripts/
If you do not see the script you want, click Cancel to exit the Schedule assistant, copy the script to the Scripts folder on the FileMaker Server computer, and run the Schedule assistant again.
To select a system-level script to run:
1. For Script name, select the system-level script.
2. Enter optional Parameters for the system-level script. Separate each parameter with a blank space. To include a blank space in a parameter, use quotation marks around the entire parameter. For example, “two words” is one parameter.
Note  Script parameters are passed to the system-level script as text. For example, if you enter the script parameter 5 + 5, then the text string “5 + 5” is passed to the script, not the value 10.
For information on system-level script parameters, see the documentation for the scripting language you are using.
3. For the option Use a user account rather than the default account to run the system-level script, specify a User Name and Password. For the user account:
Windows: The User Name can refer to a local account on the master machine or a network domain account, and it can be specified using one of the following formats: domainname\username or username@domainname.
The default account is Local System.
macOS: The User Name must refer to a local account on the master machine only and it must be specified without a domain name. The default account is the fmserver user account. See the “macOS privileges” information in the notes below.
4. For Time limit (minutes), select the maximum amount of minutes you expect the sequence to complete.
5. Select Abort schedule if time limit reached or server stopped to abort the scheduled task if the script or script sequence takes longer to run than the specified Time limit, or if the Database Server stops.
If you select Abort schedule if time limit reached or server stopped and the specified Time limit is exceeded, or if the Database Server stops, the script or script sequence is aborted and FileMaker Server logs an Error message in the event log.
If you do not select Abort schedule if time limit reached or server stopped, FileMaker Server logs a Warning message and the script scheduled task continues to run if the specified Time limit is exceeded, or if the Database Server stops. Use the following methods to stop a script that hangs in an incomplete state such as an infinite loop:
To stop a FileMaker script, select the FileMaker script on the Activity > Clients tab. Click Folder icon, then choose Disconnect.
To stop a system-level script, locate the script’s process ID in the event log and terminate the process in the Task Manager on Windows or the Activity Monitor on macOS.
Notes
To use a user account to run a script in macOS, you must add the following entries to the
/etc/sudoers file:
Host_Alias FMSHOST = yourhostname
Defaults:fmserver targetpw, timestamp_timeout=0, passwd_tries=1
fmserver FMSHOST = (ALL) /Library/FileMaker\ Server/Data/Scripts/*, /bin/kill
For the Host Alias, enter the name of the host running FileMaker Server. You cannot use “localhost” or 127.0.0.1. To find out the correct host name to use, enter the following command in the Terminal application:
hostname
To edit the /etc/sudoers file, you must be the Administrator (root) and have Administrative privileges. You can edit the /etc/sudoers file using this command in the Terminal application:
sudo visudo
macOS privileges: The User Account you can use to run system-level scripts must have the correct privileges for the actions you want the script to perform. You can use the fmserver user account or a local user account on the master machine only.
If you choose the fmserver user account, you may need to modify file permissions for the script. Your script is executed with the fmserver user ID and fmsadmin group ID, so your script file must have read and execute permissions for the fmsadmin group. Therefore, if you choose the fmserver user account, you cannot call some privileged commands from your scripts. For example, your script does not have access to the /etc folder.
Script name and Parameters added together can be a maximum of 2048 characters.
Windows: User Name can be a maximum of 104 characters, and Password can be a maximum of 128 characters.
macOS: User Name can be a maximum of 255 characters, and Password can be a maximum of 31 characters.
Related topics 
Scheduling administrative tasks