Jump to content
Server Maintenance This Week. ×

Auto run script on server


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

Recommended Posts

Greets, all:

A simple question yet I can't seem to find a definitive answer: I want to have a script automatically run (in a hosted file on FM Server 18) on the last day of every semester that will create a report (which will be further scripted to be sent by e-mail to multiple users). What do I need to code/set up so the script will run autonomously?

TIA for your replies!

Link to comment
Share on other sites

If semesters end on the same day each year you can probably setup different scheduled scripts for each semester and repeat these schedules every year.

Alternatively, if there's no rhyme or reason to the ending of semesters, create a schedule that runs every day (or if semesters always ends on a Friday, run it every Friday), and then use a table to manually register the end of semesters. Then execute the script if the current date matches a date in the table.

Link to comment
Share on other sites

Yes, that's later on, but how do I intitiate the auto-run of the script? Does Perform on Server automatically track the date/time while the file is sitting idle on FM Server?

Link to comment
Share on other sites

You initiate the run of a script in the scheduler on the server. You specify a date and time when to run a script. You can run a script once or repeat it every day, every hour, etc.

In the script you can then check the current date and time to determine whether it's a last semester day. 

I'm not sure I understand your question about PSOS. A PSOS script is triggered from a client. Not from the server. You can't run the PSOS script command on the server. 

  • Like 1
Link to comment
Share on other sites

https://www.youtube.com/watch?v=94HVrQblPcc

DB Services shows different ways to generate a PDF and email. I reference this video because it shows at the end how his report script is called by a server script schedule which is what you want to do. You'd need to add to your report script the logic to see if it's the last day of a semester. As Olger mentioned, this can be a query to a table that has a record for each last day of semester. 

Also see: https://fmhelp.filemaker.com/help/18/fmp/en/#page/FMP_Help%2Frunning-scripts-on-server.html

  • Like 1
Link to comment
Share on other sites

This topic is 1713 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.