5 Replies Latest reply on Aug 8, 2012 3:27 AM by wimdecorte

    Executing scripts...

    taddeima

      Hi All,

       

      I've set up a server program execution (Server standard v.12) calling one script hosted inside one of the database published by the server (let's call it MailDirectory.fmp12).

       

      It take data from one xls file and import them into one table MailDirectory.fmp12 (actions: delete all present records and add all records as new ones, no comparison or update logics).

       

      If I run the import script directly from MailDirectory.fmp12 it works fine, whilst if I run it through the server program - both schedule or immediate execution - it works more or less for the same time comparing with the execution directly from the db file, the outcome on the server console is "OK", but the data inside MailDirectory.fmp12 are unchanged (no deletion, no insert, no change at all...).

       

      Any suggestion on how to get rid of it?

       

      Thank you so much.

       

      Marco

        • 1. Re: Executing scripts...
          taylorsharpe

          The Server environment is a bit different and you have to take into context how the server sees things, which is as a different user "fmserver".  For example, if you import an XLS files from the server, the server can only see folders inside of /Library/FileMaker Server/Data  and nothing else.  So if your normal client you import from say your Documents folder, that is a different Documents folder than the Server sees because the Server's documents folder is at /Library/FileMaker Server/Data/Documents and not at the User's Documents folder.  Also, the fmserver User ID has to have read access to the file to import it, so make sure the permissions are good too.  Verify that you are doing those things correctly and let us know if that helps.

          • 2. Re: Executing scripts...
            taddeima

            I cannot get rid of this setup...

             

            I've set up the script import function with relative path "file:ImportData/data_migr.xls". It refers to one xls with path C:/Program Files/FileMaker Server/Data/ImportData/data_migr.xls

             

            If I stop the FM server and open "locally" the datbase with FM Pro and run the scripts it will import data correctly

             

            If I execute the same script through FM Server "Program" immediate (or scheduled) execution, the final outcome on FM Server windows is "OK" as if it has been accomplished without errors, but data are not loaded.

             

            If I activate the database on the FM Server and try to open  "remotely" using a FM Pro on the same PC which runs the FM Server it ends without importing anytihing.

             

            Is there any reference on any " how-to" documentation about these matters?

             

            Thank you all.

             

            Marco

            • 3. Re: Executing scripts...
              wimdecorte

              taddeima wrote:

               

               

               

              It refers to one xls with path C:/Program Files/FileMaker Server/Data/ImportData/data_migr.xls

               

              FMS can only import from inside the Documents folder of the Data folder.   The path you have is not valid for FMS.

              • 4. Re: Executing scripts...
                taddeima

                Ok... got it. And only specifying absolute full path!

                 

                It seems to be very close to odd behaviour concernig server scheduled backups working only on on-board phisical disks (no usb/firewire, no network shared).

                 

                Thank you all.

                 

                Marco

                 

                PS: little bit tricky considering FM is an "Apple branch" company and not so clearly documented I should say...

                • 5. Re: Executing scripts...
                  wimdecorte

                  taddeima wrote:

                   

                   

                   

                  It seems to be very close to odd behaviour concernig server scheduled backups working only on on-board phisical disks (no usb/firewire, no network shared).

                   

                   

                  Not really... FMS is a daemon/service and it uses the fmsadmin account on OSX and the "Local System" account on Windows.  Giving it access to say a remote volume for importing would require much more elevated permissions and would make it an potential attack vector because of it.

                   

                  You can still make FMS do what you want by using a script sequence schedule, use an OS level script (applescript, shell script on OSX, batch file or VBscript on Windows) to grab a file from a remote volume and move it to the FMS Documents folder, followed by a FM script to do the import - all in one schedule.  FMS lets you schedule those OS-level scripts in the sequence with any OS account that you want, so that you can leave FMS in its own security bubble.