Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4891 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a server-automated script that runs once a night at 11:08 PM central time called 'run_on_cron'.

The limited user 'cron' that runs this script has access to several necessary layouts and other scripts.

When user 'cron' runs the script, is user cron already logged in, or does cron log in just to run the script and then log off?

I have a default log-in script 'Opening Script' and log-out script 'Closing Script'. User cron has access to these scripts. Do they run automatically when the server logs on user cron, or are these scripts bypassed during server-automated scripts?

I created a script 'insert current timestamp' that inserts into a field. When I'm logged in as my full-access user on the east coast, it puts the timestamp in the field to match that of my computer. "6/30/2011 1:10:46 PM" But timestamps are supposed to be universal, right? Is the timestamp that gets set a reflection the time of the server or the time of my computer? Or is there some undescribed function that translates some unseen 'raw' timestamp to whatever my local time is when it's viewed in the field on a layout?

Posted

Since I've not received a reply, I've created a table and layout with one record that will be used to store the number '1' as a boolean for several fields 'script_step_1' through 'script_step_6' for various steps along the way. The opening script sets a value of one in field 'script_step_1' immediately upon logging in if the user name is cron and the opening script is activated. Likewise the closing script step stores a value of 1 in field 'script_step_2'. The 'run_on_cron' script that is automated via the server and user cron has a beginning and ending portion that sets 'script_step_3' and 'script_step_4'. A script called by script 'run_on_cron' is similarly set to store a 1 in fields 'script_step_5' and 'script_step_6'. Hopefully tonight I'll get an answer as to whether the opening and closing scripts are activated when the server automates a script and whether portions of my automated script and the script it refers to are not working. Meanwhile if anyone has insight, I'll be glad to hear it.

Edit: I've also added a time-in and time-out field so I know what time the script is activated.

The below example shows what happens when I run it from my machine instead of automated from the server. All steps are accounted for, and the time it happens is logged. I expect some or all of these to be likewise filled when the server automates script 'run_on_cron' tonight. Wish me luck!

post-60110-0-66044300-1309525903_thumb.p

Posted

I found my answers.

a. The limited user logs in each time a server-automated script starts and logs out after the script ends.

b. The timestamp is set to the time of the user's local computer, regardless of server time. So if the user is logged in at the server, the timestamp is that of the server's local time.

c. If there is a start script, the limited user does use the script. Likewise with the end script.

d. Some script-steps are off-limits to server automation, so if the opening and closing scripts include any of the offending scripts, it could destabilize the server. Since my opening script contained the 'Adjust Window' script step on the first line, nothing would work. (See red arrow in image below.)

I set this up at the beginning of the opening script, and similarly at the beginning of the closing script. The 'Go to Layout' and 'Set Field' are unnecessary, set here just to confirm that the opening and closing scripts are indeed called during script automation. (See image below.)

If[Get(AccountName) = "cron"]

Go to Layout ["Globals"(Globals)]

Set Field [Globals::script_check_step_1; 1]

Exit Script[]

End If

I also checked for script step server compatibility in all my other scripts. (See circled 'Show Compatibility' in image below.)

index.php?app=core&module=attach&section

post-60110-0-25203100-1309694166_thumb.p

Posted

Use the get( ApplicationVersion ) function: it returns "Server <version>" when run by the server. This is much more reliable than checking for a particular account, because at some stage the account name may change.

Posted

Use the get( ApplicationVersion ) function: it returns "Server <version>" when run by the server. This is much more reliable than checking for a particular account, because at some stage the account name may change.

Thanks - I'll give this a shot!
Posted

You mention that Get(timestamp) captures the user's workstation timestamp, and it does. Get (Hosttimestamp) captures the server's time.

See Fmkb article 568 (http://help.filemaker.com/app/answers/detail/a_id/568/kw/Timestamp/session/L3RpbWUvMTMwOTc4NDIwMy9zaWQvd2lUelY3eWs%3D)

Posted

You mention that Get(timestamp) captures the user's workstation timestamp, and it does. Get (Hosttimestamp) captures the server's time.

See Fmkb article 568 (http://help.filemaker.com/app/answers/detail/a_id/568/kw/Timestamp/session/L3RpbWUvMTMwOTc4NDIwMy9zaWQvd2lUelY3eWs%3D)

Thanks! I may need to use this instead.

This topic is 4891 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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