AlanP Posted September 27, 2005 Posted September 27, 2005 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!!!
Zero Tolerence Posted September 27, 2005 Posted September 27, 2005 (edited) If[Get(SystemIPAddress) ≠ Get(HostIPAddress)] I think that should work. Edited September 27, 2005 by Guest
AlanP Posted September 27, 2005 Author Posted September 27, 2005 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).
-Queue- Posted September 27, 2005 Posted September 27, 2005 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]
Zero Tolerence Posted September 27, 2005 Posted September 27, 2005 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.
-Queue- Posted September 27, 2005 Posted September 27, 2005 Yes, and how many users are connected to your machine? 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?
AlanP Posted September 28, 2005 Author Posted September 28, 2005 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.
Zero Tolerence Posted September 28, 2005 Posted September 28, 2005 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 :
-Queue- Posted September 28, 2005 Posted September 28, 2005 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:
AlanP Posted September 29, 2005 Author Posted September 29, 2005 (edited) --- Edited September 29, 2005 by Guest
AlanP Posted October 7, 2005 Author Posted October 7, 2005 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?
Recommended Posts
This topic is 6989 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now