5 Replies Latest reply on Apr 12, 2013 6:11 AM by disabled_ScottKoontz

    OS X, run sqlite3 commands via FMS schedule?

      FMS 12, OS 10.8.3

       

      I'd like to fully automate a process that includes running some sqlite3 commands to create special text files (that will then be imported into FM).

       

      Using Terminal, I would be typing:

       

      sqlite3 DB-NAME

       

      to create a table, and then running some .read commands for the rest. What am I missing when I create the following script?

       

      #!/bin/bash

      sqlite3 DB-NAME

       

      Permissions are correct, resulting error is a vague "Aborted by user".

        • 1. Re: OS X, run sqlite3 commands via FMS schedule?

          Added and tried combos of:

           

          /usr/bin/sqlite3

           

          /usr/bin/sqlite3 DB-NAME

           

          /usr/bin/sqlite3 path to server documents/DB-NAME

           

           

          and also tried combos of Account to run the system script. None of these are working.

          • 2. Re: OS X, run sqlite3 commands via FMS schedule?
            BruceHerbach

            Hi,

             

            First,  have you been able to execute the bash script file and get the desired result? 

             

            Does your script reqiure user input?   I ask this because,  I don't see how you are getting it to  do this part,  "to create a table, and then running some .read commands for the rest."  For this to be run as an FMS server side script there can't be any user input.

             

            For the bash script file itself,  make sure it has the correct permissions.  You may have to set these in a terminal session. 

             

            Bruce

            • 3. Re: OS X, run sqlite3 commands via FMS schedule?
              wimdecorte

              Is there a StdErr or StdOut file in the FMS logs folder?  If so, check those out for any clues as to what goes wrong.  If those files are not there, have yoru bash script write to a log file to report progress and errors.

              • 4. Re: OS X, run sqlite3 commands via FMS schedule?

                Bruce,

                 

                Thanks for helping. Not sure if I'm answering you correctly, but I can get the desired results by hand in terminal. I can also run bash and use the same commands by hand, although I'm not sure if when run by FMS they need some more code or quotes.

                 

                No user input. The sqlite3 DB-NAME crates the file (I has written table) and the .read  FILE creates the table. I shortened everything to the one line while troubleshooting because it's not even starting sqlite or creating the db so I can test further.

                 

                I'm not sure about your permissions comment. If I first type bas, then sqlite3 DB-NAME, it works. To run from the server I tried using the fmserver account and an administrator account. I also tried creating the file within a fmserver owned folder.

                 

                Scott

                • 5. Re: OS X, run sqlite3 commands via FMS schedule?

                  Thanks for the reply, I forgot about the error files.

                   

                  /Library/FileMaker Server/Data/Scripts/sss.sh: line 2: /usr/bin/sqlite: No such file or directory

                  /Library/FileMaker Server/Data/Scripts/sss.sh: line 2: /bin/sqlite3: No such file or directory

                   

                  It appears that I need more than the code I type by hand or that fmserver cannot see or execute sqlite3. I'll keep trying other options and watch the error file.

                   

                  Scott