Jump to content

Retrospect+FileMaker


Recommended Posts

If you need to backup your database automatically you'll find the following script helpful. See comments for explanations and watch out for broken lines.

 

 

 

-----Cut and paste here----------------

 

 

 

(* This script was developed to serve FileMaker Pro database and Retrospect backups

 

on the same Mac. The trick is that database files need to be closed before they

 

could be backed up and we also need to back up some remote directories but not

 

stay connected to those machines during daytime. It also checks if the database

 

files stay open (available for users) during the FileMaker Pro activity

 

phase of the cycle. I also implemented automatic mount/unmount cycle for the

 

remote volumes. The paths (obviously) need to be corrected to match your

 

environment - "Startup Disk" definition does not work unless you "tell" the

 

Finder. Save this script under the name "Retrospect Event Handler" and put it

 

in "Hard Drive:System Folder:Preferences:Retrospect Preferences" folder. Make

 

an alias and put it in the "Startup Items".

 

*)

 

 

 

on idle

 

--If Retrospect is not active make databases available

 

--but do everything in the background (invisibly)

 

set Retrospect_properties to info for file "Hard Drive:Applications (Mac OS 9):Retrospect Folder:Retrospect"

 

if busy status of Retrospect_properties is false then

 

set db_list to {"File_1.fp5", "File_2.fp5", "File_3.fp5", "File_4.fp5", "File_5.fp5"}

 

set root_dir to "Hard Drive:Documents:FileMaker:"

 

--First make sure that FileMaker itself is running

 

set FileMaker_properties to info for file "Hard Drive:Applications (Mac OS 9):FileMaker Pro 5.5 Folder:FileMaker Pro"

 

tell application "FileMaker Pro"

 

if busy status of FileMaker_properties is false then

 

activate

 

end if

 

--Then verify that all databases are open

 

repeat with i from 1 to count items of db_list

 

set cur_db to item i of db_list

 

if not (exists window cur_db) then

 

activate

 

set full_path to root_dir & cur_db

 

open file full_path

 

set visible of window cur_db to false

 

end if

 

end repeat

 

end tell

 

end if

 

return 30 --Repeat every 30 seconds

 

end idle

 

 

 

on RetrospectStart()

 

--Since we need to back up our database files - quit FileMaker

 

set FileMaker_properties to info for file "Hard Drive:Applications (Mac OS 9):FileMaker Pro 5.5 Folder:FileMaker Pro"

 

if busy status of FileMaker_properties is true then

 

tell application "FileMaker Pro"

 

quit

 

end tell

 

end if

 

--Mount remote volumes that need to be backed up

 

tell application "Finder"

 

if not (exists disk "Hard Drive 1") then

 

try

 

mount volume "afp://name:password@Remote_Mac_1/Hard Drive 1"

 

end try

 

end if

 

 

 

--Repeat for each remote volume...

 

 

 

if not (exists disk "Hard Drive n") then

 

try

 

mount volume "afp://name:password@Remote_Mac_n/Hard Drive n"

 

end try

 

end if

 

end tell

 

end RetrospectStart

 

 

 

on RetrospectQuit()

 

--Unmount remote volumes

 

tell application "Finder"

 

put away (disks whose local volume is false)

 

end tell

 

--If it is night (between 12:00 and 6:00 AM) reboot the server

 

set cur_date to current date

 

set cur_time to ((time of cur_date) / 3600) --Divide seconds by 60*60 to get hours

 

if cur_time < 6 then

 

tell application "Finder"

 

restart

 

end tell

 

end if

 

end RetrospectQuit

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...