6 Replies Latest reply on Jun 16, 2010 11:58 AM by etripoli

    Filemaker 'cron' Database



      Filemaker 'cron' Database


      I find myself needing to schedule scripts to run on a 'robot' more and more.  Has anyone come across an FM database that function in a similar way as cron?  Meaning, a table with scripts that need to run, the database containing the script, the time and frequency they need to run, and possibly the username/password with appropriate access to run the script?  Would something like that even be possible to do entirely in Filemaker, or would Applescript (on Mac) be needed?

        • 1. Re: Filemaker 'cron' Database

          Others have done this. I use Windows Taskmanager, but the basic principle is the same.


          You create a separate filemaker file and Use File Options to specify that a script be run when the file is opened. You use CRON to specify when this file is to be opened. To handle password issues, you define matching account name and passwords in this file and use Preferences to specify that this file open itself with that account name and password.


          Your last script step is usually Exit Application or Close File so that your robot file closes itself when done.


          Two cautions:


          1) If you make a mistake in your scripting and your robot script thus gets trapped in an infinite loop, there's no obvious way to tell that this has happened and your only way to terminate the script is by closing and re-opening the file.

          2) Since your opener file may be set to open itself with a high level or full access password, make sure you keep this file in a physically secure place so that you don't expose your system to unauthorized access due to someone getting a copy of your opener and using it to open your files.

          • 2. Re: Filemaker 'cron' Database

            Close, but I'm talking about a database that can handle dozens, or more, 'scheduled' scripts.  I'm now thinking something along the lines of the server Admin Console interface.  A database running on an FM robot, that mimics the look and feel of the Schedules view of the Admin Console.

            • 3. Re: Filemaker 'cron' Database

              Which, course can be done. The challenge would be to have proper control of the scheduling. Using OnTimer scripts are one option that comes to mind.


              I'm curious as to why you see a need for such a database.

              • 4. Re: Filemaker 'cron' Database

                Yes, the timing would be tricky.  I'm thinking a never-ending looping master script that runs through the records, checking it record to see if it is time for it to run.  If so, then the master script runs the script associated to the record, tracks the start time, the stop time, any success/failure messages returned, and then continues on.


                The fun part will be to figure out how to associate a script, coming from a seaprate database, to a record.  The reason that some scripts need to be run on a recurring basis, during certain times of the day.  Other scripts should only be run once a day, or once a week.  It would be helpful, even advantageous, to be able to easily create, track, maintain, view, etc., many robot-scheduled scripts all from one table & layout.

                • 5. Re: Filemaker 'cron' Database
                  Steve Wright

                  Take a look at http://www.dacons.net/fmplugins/scriptfire/  

                  This may or may not be useful to you with setting schedules / intervals for a variety of scripts.

                  • 6. Re: Filemaker 'cron' Database

                    Thanks SWS, that looks quite useful.  I think it would make it possible to schedule scripts for multiple databases in one place.  But, the management of the scripts doesn't look very transparent.  I think I'm leaning more towards using Applescript to run the scheduled scripts, selected by the record-looping master FM script.