beaconny

Advice on backing up database in P2P environment

Discussion created by beaconny on Jan 30, 2014
Latest reply on Jan 30, 2014 by mikebeargie

Environment: Running in a Mac environment only. Using FM 12 and FM 13. FM application is a based on the separation model. The user accesses the Interface (one file) which gets its data from the Data file (a second file). I need to only backup the Data file. The Interface and Data files will be placed in a directory (not shared) on a local computer on the network. The backup will be placed in a separate directory (shared) on the same computer.

 

I understand that the Data file must be closed before it is backed up.

 

I found the following script on the FM Help site. You are instructed to attach this script under File Options > Script Triggers > OnLastWindowClose.

 

Set Field [<table name>::Count Field; <table name>::Count Field + 1]

If [<table name>::Count Field > 4]

Save a copy as ["Backup Copy.fmp12"; copy]

Set Field [<table name>::Count Field; 0]

End if

 

Question 1: When the Interface file is closed, is the Data file (used by the Interface) also automatically closed? Does FM also then consider both of these files closed? In other words, if the script is triggered OnLastWindowClose, will both files really already be closed when the script is performed?

 

If the answer to question 1 is No, then suggestions are welcome.

 

Question 2: This concerns closing the application file on the host computer. Since the host should not close the application while there are still users remotely connected, how can I check, through a script, to make sure that all users are disconnected?

 

To phrase this differently, how can I count the number of users who have opened the application remotely and have not closed the application? There was, until FM ver 6, a function get(UserCount), but it is gone. Hopefully there is something better than calling each person on the phone.

 

I have been getting great advice from this site. Hoping my luck holds out. Thanks for any help.

Outcomes