7 Replies Latest reply on Dec 7, 2013 7:03 AM by lhallberg

    How to execute jar file in server script?

    aanshi

      I want to execute jar file.previously I used send event for pro but now want to execute this file from server. But send event is not compatible with server?What can we used instead of that ??

        • 1. Re: How to execute jar file in server script?
          IanJempson

          The ScriptMaster plugin will let you do this.

          • 2. Re: How to execute jar file in server script?
            aanshi

            But i dont want to use any plugins ...is there another way ??

            • 3. Re: How to execute jar file in server script?
              lhallberg

              For OS X running FileMaker Server:

               

                   1. Create a shell sript on FileMaker Server something like

              #!/bin/sh
              java
              -jar path/to/jar/file.jar

                   2a.  Schedule it to run via FM Server Schedules

               

              -or-

                   2b.  Alternatively, create a FileMaker script with the step "Insert from URL". Have the URL point to a PHP page hosted on FileMaker Server.  Have the PHP page execute the shell script.

              <?php

                   $output = shell_exec("./myscript.sh");

              ?>

               

              Use new "Perform Script on Server" step to execute the script which "Inserts from URL".

              • 4. Re: How to execute jar file in server script?
                aanshi

                Hey thanks for reply finally its working.....I used option 2 ..its workign ...Can you please write or explain first option I dont understad what you are trying to say.

                How to create shell script on server ?

                • 5. Re: How to execute jar file in server script?
                  lhallberg

                  Option 1 is not a user event driven option.

                   

                  It works on the basis that FileMaker Server can have scripts scheduled to run at specific times, or time intervals.  These scripts can be FileMaker Script, or Shell Scripts for the OS it's installed on.

                   

                  To use this method, put your shell script in /Library/FileMaker Server/Data/Scripts/.  Make sure the script owner:group is fmserver:fmsadmin, respectively, and has executable privielges.

                   

                  Open the FileMaker Server admin console and create a new schedule, specifying your shell script.

                   

                  This option would work if you needed the script to run at regulary intervals or a spcific time.

                   

                  Glad it's working for you.

                  • 6. Re: How to execute jar file in server script?
                    aanshi

                    I try this ..but after execute this script ..status is set as invalid command

                    • 7. Re: How to execute jar file in server script?
                      lhallberg

                      Make sure your shell script is valid.  Try running it from the command line.  Usually if it works when executed manually it will work when scheduled by server.

                       

                      If it works when executing it manually, then there may be a permission issue.

                       

                           1.  Double check the permissions on all files referenced in the script and of the script itself.  Also make sure they are all executable.

                       

                           2. Shell scripts executed by FileMaker Server are ran as user:group fmserver:fmsadmin.  If your shell script attempts to do something outside of the user:group permissions it will fail.  Make sure you specify in your Script Schedule an alternate user:pass that has permissions to execute the shell script.