Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Automatic Backup Script - Host Only

Featured Replies

Is there a way to specify in a shutdown script where you can save a copy of the file ONLY when the host closes the file.

For example in the script you have the line that says

save a copy as ["backup.fp7"]

Now is there a way that it WILL NOT save a copy of the file if the user just remoted in but WILL save a copy of the file if the host closes the file down?

THANKS!!!


If[Get(SystemIPAddress) ≠ Get(HostIPAddress)]

I think that should work.

Edited by Guest

  • Author


If[Get(SystemIPAddress) ≠ Get(HostIPAddress)]

I think that should work.

Thanks Zero!

The scriptmaker didn't like "HostIPAddress" so I replaced it with "HostName" and that seemed to work when I tested it out. However I'm wondering if you know why it didn't like HostIPAddress...I'd like to make sure I'm not doing anything wrong. (also I tried doing HostName for both Get functions and that didn't work).

HostName will never equal the IP address. Plus, Get(SystemIPAddress) will return a list of all IPs for connected machines.

You would probably be better off using

If [Get(MultiUserState) <> 2]

HostName will never equal the IP address. Plus, Get(SystemIPAddress) will return a list of all IPs for connected machines.

You would probably be better off using

If [Get(MultiUserState) <> 2]

Are you sure Queue? Mine I ran that from a file on our FM7SA and it only gave me my ip. And we have almost 50 users connected.

Yes, and how many users are connected to your machine? :wink2:

This would not be useful for a file which is being served via Server, only one where a user is hosting, unless, of course, you have closed the file on Server and opened it locally.

You cannot save a copy while the file is being hosted by Server, anyway, can you?

  • Author

Jeesh thanks for all the help guys!

I just thought of these:

To restrict by user:

If [Get(UserName) = "John Doe"]

How would you do a weekly backup (for example only backs up on a friday). I know I saw something like that somewhere but can't find it now.

Ahh I thought it was giving me the IP that was connected to the actual file, not to my machine.

And no, you can't save as a copy with a file opened on the server, but I was thinking that the GETIP's would work fine either way.

Ah well, I once again bow down to your superior knowledge :

For a weekly backup, try something like

If [Get(MultiUserState) <> 2 and DayOfWeek(Get(CurrentDate)) = 6]

Note that if you closed the files on the host machine several times on Friday, then the backup would occur several times. You could get around this by setting a global, or field in a single-record Preferences table, once the backup occurs. Check the value of this field each time the If statement is true and only backup when it it is unset or zero, etc. Then have your on open script unset the field when DayOfWeek(Get(CurrentDate)) <> 6, so that it is ready for the following Friday's backup.

Zero, give yourself a few thousand more posts and you'll get there. :wink2:

  • Author

---

Edited by Guest

  • Author

it works great thanks!

  • Author

Let me ask a further question on this. Now I'm hosting the files 24/7...is there a way to specify or somehow create a script that will do the backup at a certain time or is this something only filemaker server is capable of?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.