Running system script files

FileMaker Server can run system script files, such as a Windows batch command, VBScript, or macOS shell script (bash, Perl, Python). You create a System Script scheduled task, specify the script file and optional script parameters, the user account to use to run the script, and when to run the script. Use system scripts to perform tasks outside of FileMaker Server.

To run a script as a scheduled task, you must place the system script file in the FileMaker Server Scripts folder:

  • 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/
  • Linux: /opt/FileMaker/FileMaker Server/Data/Scripts/

For information about creating system scripts, see the documentation for the scripting language you want to use.

Notes  

  • You must include error-handling and branching logic in your system scripts. Make sure that the script syntax is correct and does not stop responding because of infinite loops or the availability of external resources. You can select End the schedule if the timeout is reached to stop the system script schedule if the script takes longer to run than the specified time limit, or if the Database Server stops. If you do not select this option and a system script stops responding, look in the Event.log file for the process ID of the script to terminate. (See Event log.)
  • In the system script schedule, you must specify an account that has the correct privileges to run the system script. (See Specifying script schedule details.)
  • Enable some form of logging in your script so that you can troubleshoot possible permissions issues. Refer to the Apple website for information on creating log files using macOS shell scripts.
  • Do not use system scripts that invoke a user interface.