4 Replies Latest reply on May 11, 2016 7:40 AM by ZoocMan85

    On Timer Backup Script

    ZoocMan85

      What would be the calculation for an install on timer script to run daily at 11:00PM? Thanks

        • 1. Re: On Timer Backup Script
          mikebeargie

          FileMaker Server is the best way to perform scheduled backups.

           

          An ontimer script depends on a file being open. If someone closes the file, your process breaks entirely.

           

          Ontimers are also not scheduled. They are literally on a timer. EG, a set number of seconds from the time you install it.

           

          So you would need to calculate the difference from the current time, until 11pm, when you install an ontimer script step, which would just be:

          GetAsTimestamp( Get(CurrentDate) & "11:00:00 PM" ) - Get(CurrentTimestamp)

           

          To make it run every day, at the end of your ontimer script that runs, you need to install ANOTHER ontimer script using the same calculation, basically calculating the difference until tomorrow's 11:00pm time.

          Case(

             Get(CurrentTime) > 11:00:00 PM and Get(CurrentTime) < 11:59:59 PM ; GetAsTimestamp( Get(CurrentDate) + 1 & "11:00:00 PM" ) - Get(CurrentTimestamp);

             GetAsTimestamp( Get(CurrentDate) & "11:00:00 PM" ) - Get(CurrentTimestamp)

          )

          Basically setting the next ontimer to run tomorrow at 11pm when the current time is between 11pm-12am, otherwise setting it to run at 11pm for the current date.

           

          But seriously, that is a massive pain to setup, and very unreliable for the reasons I mentioned. If you want a backup that works without this stuff, host on filemaker server.

          1 of 1 people found this helpful
          • 2. Re: On Timer Backup Script
            ZoocMan85

            Im just going to set it to 1500 seconds and this way its every 24 hours. The solution will always be open cause its running in a p2p environment . Thanks Mike

            • 3. Re: On Timer Backup Script
              mikebeargie

              I would read up a lot more on what causes timers to fail. P2P is a fragile environment for sure that requires a lot of hands on attention and checks to make sure things are working properly. Things the server can do (and notify you on failure) automatically.

               

              Also 1500 seconds is only 25 minutes. I think you mean you want 86400, which is 24 hours converted to seconds.

              • 4. Re: On Timer Backup Script
                ZoocMan85

                yeah my bad on that one mike lol.