5 Replies Latest reply on Dec 8, 2012 4:03 AM by Malcolm

    FileMaker Server 12—fmsadmin command line parsing bug or FTS erratum?

    ptinreston

      Attempts to execute the example system script described in Reference 1 (see below) led to consistent error messages and failure, either as an FileMaker Server Admin Console schedule item or as an independent script. Here is the script, transcribed from Ref. 1:

       

      #!/bin/sh

      fmsadmin send -m “Pausing” -u <user> -p <pass>

      fmsadmin pause –u <user> -p <pass>

      fmsadmin backup -u <user> -p <pass>

      fmsadmin resume -u <user> -p <pass>

      fmsadmin send -m “The backup is complete. Files are again open for use” -u <user> -p <pass (sic)

       

      Appropriate substitutions were made for the Admin Console's user and pass parameters (with brackets removed, of course), e.g.,

       

      fsadmin pause -u 'Joe Doaks' -p j0e5p4s5w1Rd

       

      FM Server e-mail error alerts generated when this script failed indicated that the -u flag or the user name itself was taken by at least one of the fmsadmin commands as being the name of the database that was intended to be paused. Here is the text of one of those messages.

       

      • 2012-12-07 01:37:43.656 -0500 Error:92 FMS-12-Joe-Doaks-Computer.local:Could not complete operation on database "-u" because it is not currently open.

       

      • 2012-12-07 01:37:43.656 -0500 Error:92 FMS-12-Joe-Doaks-Computer.local:Could not complete operation on database "Joe Doaks" because it is not currently open.

       

      Attempts were then made to execute each line of the script as a separate command manually (i.e., interactively in the Terminal app). The send (message) command worked as expected but the pause command returned unexpected requests for username and password, even though they were provided in the command line as -u and -p parameters.

       

      Ultimately, one database file name was specified for the pause, backup, and send commands, and the script executed without failure.

       

      The syntax for the fmsadmin pause command in Reference 2 (see below — emphasis mine, btw) states that

       

      Usage: fmsadmin PAUSE [FILE...] [PATH...]

      ...

      Pauses the specified databases (FILE) or all the hosted databases in the

      specified folders (PATH). If no FILE or PATH is specified, pauses all

      hosted databases.

       

      As a result of this experience, then, it would appear that the fsadmin pause does require a file or path to be specified, which is contrary to the syntax specification.

       

      So, after all this, did I make a mistake, or there a problem with the fsadmin interpretter, or is there something else that's wrong? I greatly appreciate any guidance on this, so thanks in advance.


       

      References:

      1. FileMaker Training Series 4, Module 10 — FileMaker Server, Lesson 10.4, Example 10.4.3 (beginning at page 10-47).

      2. FileMaker Server 12 Command Line Help reference for "pause" command (in Mac OS X bash environment), explicitly: fmsadmin help pause


       

      Message was edited by: ptinreston

        • 1. Re: FileMaker Server 12—fmsadmin command line parsing bug or FTS erratum?
          wimdecorte

           

           

          Appropriate substitutions were made for the Admin Console's user and pass parameters (with brackets removed, of course), e.g.,

           

               fsadmin pause -u 'Joe Doaks' -p j0e5p4s5w1Rd

           

           

           

          To avoid this kind of problem, always try to use one-word usernames when you need the command line.

          I see that you are using single quotes, I'm pretty sure it expects reqular quotes.

          • 2. Re: FileMaker Server 12—fmsadmin command line parsing bug or FTS erratum?
            ptinreston

            Thanks, wimdecorte, for your prompt reply.

             

            I tried that, and the problem persisted. 

             

            I also just now changed my user name to replace the space with an underscore.  No joy.

             

            Are you able to use the fmsadmin pause command without a file or path specification (on a Mac with Terminal)?  If so, could I trouble you to send to me a copy of the successful command line entry?

             

            Again, thank you very much.

            • 3. Re: FileMaker Server 12—fmsadmin command line parsing bug or FTS erratum?
              Malcolm

              Appropriate substitutions were made for the Admin Console's user and pass parameters (with brackets removed, of course), e.g.,

               

               

                   fsadmin pause -u 'Joe Doaks' -p j0e5p4s5w1Rd

               

              There is a typo in the instructions: the command is fmsadmin

               

              Malcolm

              • 4. Re: FileMaker Server 12—fmsadmin command line parsing bug or FTS erratum?
                ptinreston

                Good spotting, Malcolm... thank you for mentioning this!

                 

                The error you discovered only occured when I retyped from the Terminal screen to my discussion post.  For once I didn't just copy and paste, because I used a user name and password that are similar to mine but not exact.  When I was testing the script line-by-line, I did use the fmsadmin command, as you pointed out. 

                However...

                 

                I realized as I was responding to your comment that I had copied the text of the script from the FTS module and pasted it into Text Edit.  I had then replaced the user and pass tags with the appropriate text using "Replace All".  When the script failed, I tested each individual line by copying it out of the text and pasting it into the Terminal command line. 

                 

                By now, I'm sure you've figured out my error... there was something in the white space of the copied text that was causing the problem.  I went through the script and re-typed all the spaces and carriage returns... and the script worked.  So, in trying to avoid transcription errors by copying and pasting, I had brought along improper characters hidden in the white space — thus hoisting myself on my own petard. 

                 

                Thank you again, Malcolm, for your reply, and for getting me on the path to the solution. 

                • 5. Re: FileMaker Server 12—fmsadmin command line parsing bug or FTS erratum?
                  Malcolm

                  I realized as I was responding to your comment that I had copied the text of the script from the FTS module and pasted it into Text Edit.

                   

                  You're not the first to get caught by this. I've done it too. Frustrating isn't it?

                   

                  Malcolm