Applescript and Filemaker Server 7
Here's something very unusual we recently noticed about Filemaker Server 7 at my day job. If you use its built in Scheduler to schedule backups, it will only let you send a backup to the same disk that Server resides on (previous version of Filemaker Server did not have this limitation). Since that's also where the databases themselves live, backing up to that drive is kind of silly. With your live files and your backed up files on the same drive, you instantly lose both if that drive dies. See? Silly.So, we cooked up a quick and dirty folder action Applescript solution to force the files onto an external firewire drive. Check out the script after the jump.
property dialog_timeout : 30
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
get weekday of (get current date) as string
set Today to result
if Today = "Monday" then
move added_items to folder "mon" of disk "BACKUP" replacing yes
else if Today = "Tuesday" then
move added_items to folder "tue" of disk "BACKUP" replacing yes
else if Today = "Wednesday" then
move added_items to folder "wed" of disk "BACKUP" replacing yes
else if Today = "Thursday" then
move added_items to folder "thur" of disk "BACKUP" replacing yes
else if Today = "Friday" then
move added_items to folder "fri" of disk "BACKUP" replacing yes
end if
end tell
end try
end adding folder items toThis is attached as a folder action script to the backup folder on the Filemaker Server, and it's run whenever that folder is updated (which happens every night at 12:00 AM when Filemaker Server performs its scheduled backup). When the backup is complete, the Applescript first notices that that folder has been altered. This calls it into action. First, it checks to see what day of the week it is, and then moves the contained files to a folder of the same name on an external drive. So, if today is Monday, the backed up files will be moved to the "mon" folder on the external drive, and so on with the rest of the weekdays. On the following Monday, it starts again by overwriting the files already in the Monday folder (we only keep a week's worth of database backups around).
Now, I know there are more elegant ways to get this same routine done. I'm hardly a seasoned Applescripter. But this worked, so I thought I'd pass it on. I hope you found something useful here.
Incidentally, this same script has prompted me to devise a way to keep my desktop clean. I've attached it to a folder on my desktop I've labeled "to_dropbox." Anything dropped into that folder is moved, via the same daily routine, to a folder called "dropbox" on my external hard drive. At the end of the week, I can go through there and weed out what I want to keep, and what I want to trash. Plus, if I want to go back to a "Tuesday" version of a given file, I have it. Finally, it keeps the clutter off of my desktop.
Share
Categories
Here's something very unusual we recently noticed about Filemaker Server 7 at my day job. If you use its built in Scheduler to schedule...
Add a Comment
Email me and I can help you troubleshoot this issue :) moop2000 [at] mac dot com
October 06 2005 at 1:56 PM Report abuse Permalink rate up rate down ReplyMichael: Then I'd very much like your assistance. All I want to do is schedule backups of my FM 7 databases to an external firewire hard drive, using FM Server 7's Scheduler. Whenever I try to identify a location outside of Scheduler's "default," the schedule does not run. Ideas? I appreciate it.
October 06 2005 at 10:22 AM Report abuse Permalink rate up rate down ReplyI wanted to inform you that it is possible to send different backups to different locations with FileMaker Server 7. You can set a default location in the settings to be on a different disk, but beyond that, you can set individual locations when you setup the schedules. I've done a lot of work with FileMaker, and I am very familiar with the server product.
October 06 2005 at 8:02 AM Report abuse Permalink rate up rate down ReplyHot Apps on TUAW
Deals of the Day
more deals- Used Apple iMac 17" Core 2 Duo 1.83GHz for $430 + $28 s&h
- Lounge Deluxe Stand for iPhone / iPod touch for $28 + $8 s&h
- Brookstone Surround-Sound Earbuds for $14 + $7 s&h
- Refurbished Skullcandy Tokidoki Smokin' Buds Mic'd Headset for $5 + $2 s&h
- Stitchway Backup Battery for iPod / iPhone for $5 + free shipping
- Used Apple MacBook Pro 2.4GHz 15" LED Laptop for $1,030 + $29 s&h
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



3 Comments