6 Replies Latest reply on Apr 26, 2010 10:50 AM by lawson23

    Backup db's

    lawson23

      Title

      Backup db's

      Post

      I would like to backup my few db's in Filemaker Pro Advanced 10 that we use via web publishing.

       

      I can do this anyway (scheduled or when records are written) as long as it is automatic so I need either a script inside FMP or a batch outside.

       

      here are my thoughts but I'm sure everyone has a better method.

      Is there a command I can run that would close one specific db as I can set this DB to copy the DB's as it is closing for a backup.  I don't know of anyway to do this though on a schedule or anything.

       

      I was thinking of issuing a Kill command on the filemaker pro advanced.exe file I'm taking it this would also kill "fm web publishing.exe"  Then use any standard xcopy command and then send a command to open a db that will open all db's backup which is how I start FMP when the machine is rebooted.

       

      I'm sure there is a better way than doing the kill command so if anyone can suggest a better backup method for FMP please reply.

        • 1. Re: Backup db's
          lawson23

          instead of using the kill command outside of filemaker I could use a "install OnTimer Script" in my "open script" to execute my backup (Save a copy as) script and then also set "install OnTimer Script" to run at the end of my backup script which I run on close of filemaker this would set the script to run on a continual loop.  Would have to remove the run of the backup on close but would not matter because the db was be getting backed up on an interval in seconds I specify?

           

          What do you think of this instead of my first thought?  Or any additional thoughts?

          • 2. Re: Backup db's
            (O_O)

            If you're using Pro, use a FileMaker Script to create a compact copy of all your files.

            You can then send a visual basic script or an apple script to run the script.

             

            This will keep the copy of FileMaker Pro running, while safely creating a backup of your files and have a process that runs as a schedule on the OS.

            • 3. Re: Backup db's
              (O_O)

              Just so you know : 

              http://www.connectingdata.com/downloads.htm

              There's a download of run script by redirection that has a VB script that shows an example of code in the container field on how to run a script in FileMaker using VB script.

               

              If you're looking to do this through Applescript : 

              http://www.fmpromigrator.com/downloads/demo_software/filemaker7_applescript_reference02.pdf

              pg 4 of the applescript reference tells you how to run a script in FileMaker through Apple Script.

              • 4. Re: Backup db's
                lawson23

                having a little trouble figuring out this script.  When I run the DB it opens up and you select numbered scripts.

                 

                I then generate the vbs and look at the code and can't figure out how to edit it to how I need or use the db you download so it generates the proper code.

                 

                having a little trouble figuring out this script.  When I run the DB it opens up and you select numbered scripts.
                
                
                
                I then generate the vbs and look at the code and can't figure out how to edit it to how I need or use the db you download so it generates the proper code.
                
                
                
                ' Region Description
                '
                ' Author: Wim Decorte
                ' Version: 1.0
                ' Description:  Calls a FM script.  The name of the file and the
                '               name of the script are passed as command line
                '               arguments when executing this VBscript
                ' 
                ' 
                ' EndRegion
                
                
                Option Explicit
                
                Dim fmApp, fmDocs, fmDoc
                Dim theFile, theScript
                
                
                ' check that there were 2 arguments
                If WScript.Arguments.Count <> 2 Then
                 ' do nothing at all, fail silently
                Else
                 theFile = WScript.Arguments.Unnamed.Item(0)
                 theScript = WScript.Arguments.Unnamed.Item(1)
                
                 ' hook into FileMaker
                 Set fmApp = CreateObject("FMPro.Application")
                 fmApp.Visible = True
                 
                 ' get the collection of open files
                 Set fmDocs = fmApp.Documents
                 
                 ' go find our target file
                 For Each fmDoc In fmDocs
                  If InStr(LCase(fmDoc.fullname), LCase(thefile)) > 0 Then
                   ' this is our file, run the script
                   fmDoc.dofmscript (thescript)
                  End If
                 Next
                
                End If
                
                ' clean up
                Set fmDoc = Nothing
                Set fmDocs = Nothing
                Set fmApp = Nothing

                 

                 

                Where do I tell it which DB to interact with and which script?

                Example DB is BBBB.fp7  Example Script is "script123"

                • 5. Re: Backup db's
                  (O_O)

                  The comment at the top of the VBScript should answer your question.  

                  The VBscript takes 2 command lines, one is the file and one is the script.

                  The first variable is the file name and the second the script name.

                   

                  so when you run the VBscript, it would be : <Vbscriptname> BBBB.fp7 script123

                   

                  There's no need to edit the code.

                  • 6. Re: Backup db's
                    lawson23

                    ok so if I name the script fmpscriptrunner.vbs

                    then in the schedule task I would call fmpscriptrunner.vbs BBBB.fp7 script123

                    or put that command in a batch file and call the batch file in the scheduled task.