September 27, 200520 yr 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!!!
September 27, 200520 yr If[Get(SystemIPAddress) ≠ Get(HostIPAddress)] I think that should work. Edited September 27, 200520 yr by Guest
September 27, 200520 yr 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).
September 27, 200520 yr 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]
September 27, 200520 yr 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.
September 27, 200520 yr 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?
September 28, 200520 yr 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.
September 28, 200520 yr 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 :
September 28, 200520 yr 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:
October 7, 200520 yr 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