4 Replies Latest reply on May 11, 2016 4:50 AM by user5571

    Server Schedule - Export to shared path/Windows

    user5571

      What's the best way to get FileMaker Server to export records (ie a .CSV file) on a regular schedule to a share path on the network?

       

      I see 2 options...

       

      Option 1) Use FileMaker Server's console to run to 2 FileMaker Schedules...

       

            a) setup a Schedule to run a FileMaker Script to export the records to the 'documents' path

            b) setup a Schedule to run a "system level" script  (ie create a batch script that 'moves' the exported file out of the documents directly to the desired path). 

       

      Option 2) Use FileMaker client on the server and Windows "Task Scheduler'

       

            a) install FIleMaker client on the server

            b) create a FIleMaker 'opener' file that opens FIleMaker client, connects to the hosted database and exports records directly to the path (since client can do that!), then quits the client

            c) Create a Windows Task Schedule that simply opens a batch script that opens the FIleMaker "opener".

       

      I don't particularly like either option as it seems I always have troubles (ie running the Window's Task Scheduler unattended, conflicts with other users that happen to be using the server for something else, etc).

       

      Any advice out there or other ways to achieve this?  Where can I find some sample batch scripts using variables (ie to pass the filename of the export)?

        • 1. Re: Server Schedule - Export to shared path/Windows
          BowdenData

          Create a single "script sequence" scheduled task on your FM server. This allows you to chain together FM scripts with OS scripts. That way you don't run into timing issues between two schedules.

           

          In your case, the first action in the sequence would be the export of the data from the database. The second action would be an OS script to move the file(s) to the appropriate location. Sounds like you are on Windows since you refer to a batch script. If that is the case, you can use that (a batch file) or VBScript. If you do some searching, you will find plenty of examples of both types that include parameter passing.

           

          Look in the FileMaker Server help for more information about Script Sequences.

           

          NOTE: You will likely run into permissions issues with moving the FM export file to the file server. By default, the FM server runs under the Local System account on Windows. For security, this account does not have permissions for copying to external locations. In this scenario, it is common to have the FM server process run under another account that does have the necessary permissions to access the file server as well as what it needs to run the FM server itself.

           

          Don't quote me 100% on this caveat as I don't have much experience with running more recent versions (FM14 and higher) on more current versions of Windows Server.

           

          HTH.

           

          Doug

          1 of 1 people found this helpful
          • 2. Re: Server Schedule - Export to shared path/Windows
            user5571

            Thanks Doug... I appreciate the help...  I forgot about the Script Sequences.   Do you know if an OS script could also be used to launch FIleMaker Client on the server to perhaps generate PDFs or connect to Outlook (with Outlook Communicator)... other 'robot' function that can't be performed by FileMaker Server?

            • 3. Re: Server Schedule - Export to shared path/Windows
              wimdecorte

              user5571 wrote:

              Do you know if an OS script could also be used to launch FIleMaker Client on the server to perhaps generate PDFs or connect to Outlook (with Outlook Communicator)... other 'robot' function that can't be performed by FileMaker Server?

               

              It is possible but I would very highly recommend AGAINST it... if you need robot functions then set up a robot machine and automate it there but leave the FMS machine to do its own thing.

               

              FMP is a user application that requires a user session, FMS is a service that does not, mixing the two does not make for the best stability.

              1 of 1 people found this helpful
              • 4. Re: Server Schedule - Export to shared path/Windows
                user5571

                Thanks Wim.  Sure but many of our clients don't have the resources ($) to simply setup a robot machine that performs a task that isn't performed that frequently.