Specifying script schedule details

Tip  Many of the schedule details are set using a dialog box that opens in front of the main window. To apply changes that you have made in the dialog box, click outside the dialog box on the main window.

  1. Select the Schedule Type.

  2. Schedule type

    Additional information

    FileMaker Script

    • Select the Database from the list of hosted databases.

    • Select the Script from the list of FileMaker scripts in the selected database.

      If you still cannot see any scripts for the selected database, check whether the FileMaker Script Engine (FMSE) is running. If it is not running, use the command fmsadmin start fmse to start it. See CLI help for the start command.

      Script names must be unique. If your database has scripts with the same name, only one of the scripts is included in the list.

    System Script

    • Select the Script from the system scripts that are available in the Scripts folder.

    • Enter any Parameters that are required.

      Note  Script parameters are passed to the FileMaker 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 script parameters, see Claris Pro and FileMaker Pro Help.

    • If the script needs to run under a non-default account, enter the Account information.

      • FileMaker Server only, Windows: The User Name can refer to a local account on the primary 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.

      • FileMaker Server only, macOS: The User Name must refer to a local account on the primary machine only and it must be specified without a domain name. The default account is the fmserver user account. See the information about macOS privileges in the notes below.

    • Optionally set a Timeout for the script.

    Script Sequence

    • Select the Database from the list of hosted databases.

    • Select the Script from the list of FileMaker scripts in the selected database.

    • Select the system script to precede the FileMaker script, with any parameters that are required.

    • Select the system script to follow the FileMaker script, with any parameters that are required.

    • If the script needs to run under a non-default account, enter the Account information.

    • If you omit both the pre-processing and post-processing system scripts, then the Schedule Type is changed to FileMaker Script instead of Script Sequence.

  3. Enter the Schedule Name.

  4. Select the Repeat of the schedule. See Examples of repeating schedules.

  5. Choose

    To

    Once

    Run once, on the specified date and time.

    Daily

    Run on a daily basis:

    • Run once a day, with Time set to At, starting at specific time, and beginning on the date entered.

    • Run multiple times daily, with Time set to Between.

    Weekly

    Run on one or more days. For Days of the Week, select the days of the week when you want the schedule to run.

    Every N Days

    Create a schedule that has a specific interval in days, such as every 2, 3, or 4 days. For Run Every, select the interval in days.

    • Select the Start Date or leave the current date.

    • For all schedules except Once, you can set an ending date by selecting Set End Date, then selecting a date from the calendar.

    • To run a scheduled task once, select At for Time. Then, specify the time when you want the scheduled task to run.

    • To run a scheduled task multiple times, select Between for Time. Then, specify the time range between 00:00 and 23:59 when you want the task repeated. Then, for Repeat Every, specify the frequency for when the task should be repeated in minutes or in hours.

Notes 

  • To use a user account to run a script on the Linux platform, you must add the following entries to the /etc/sudoers file:

    • FileMaker Server only:

      Host_Alias FMSHOST = yourhostname

      Defaults:fmserver targetpw, timestamp_timeout=0, passwd_tries=1

      fmserver FMSHOST = (ALL) /opt/FileMaker/FileMaker\ Server/Data/Scripts/*, /bin/kill

    • Claris Server only:

      Host_Alias FMSHOST = yourhostname

      Defaults:claris targetpw, timestamp_timeout=0, passwd_tries=1

      claris FMSHOST = (ALL) /opt/Claris/Server/Data/Scripts/*, /bin/kill

  • To use a user account to run a script in macOS (FileMaker Server only), 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

  • FileMaker Server only, macOS privileges: The User Account you can use to run system 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 primary machine only.

    If you choose the fmserver (FileMaker Server only) or claris (Claris Server only) user account, you may need to modify file permissions for the script. Your script is executed with the fmserver or claris user ID and fmsadmin (FileMaker Server only) or claris (Claris Server only) group ID, so your script file must have read and execute permissions for the fmsadmin or claris group. Therefore, if you choose the fmserver or claris 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.

  • FileMaker Server only, Windows: User Name can be a maximum of 104 characters, and Password can be a maximum of 128 characters.

  • FileMaker Server only, macOS: User Name can be a maximum of 255 characters, and Password can be a maximum of 31 characters.