Jump to content
Server Maintenance This Week. ×

stderr and stdout


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

Recommended Posts

Using FileMaker 11 on a Mac, there are two files in the "FileMaker Server/Logs/" directory: stderr and stdout, which contain the console output of a bash script run via FileMaker Server scheduled system script. Is there any equivalent on Windows? I'm using FileMaker 12 on Windows Server 2008 R2 and I can't find the console output of my cmd script (when run by FileMaker Server scheduled system script).

 

The reason I'm looking for this output is because my script is failing unless it is run by an Administrator account and I'm having a difficult time debugging it since I can't see the output/errors.

Link to comment
Share on other sites

I still don't know if FileMaker Server saves the output automatically, but I was able to do it manually by redirecting the output. I created a generic "calling" script, which redirects the stdout and stderr to log files in the "FileMaker ServerDataDocuments" directory:

:: FILE NAME  run_cmd_script.cmd
:: LOCATION   FileMaker ServerDataScripts
:: PURPOSE    Redirect output of a cmd script to log files, when run by FileMaker Server.
:: USAGE      Call this script with a single parameter, which is the name of the script to run.
::            The script to run should be in the same directory as this script.

"%~dp0%~1" >>"%~dp0..Documentscmd_stdout.log" 2>>"%~dp0..Documentscmd_stderr.log"

 
I've also started using PowerShell, and was disappointed to find out that PowerShell scripts could not be invoked directly by FileMaker Server. I created a slightly modified version of the above script to run PowerShell scripts:

:: FILE NAME  run_powershell_script.cmd
:: LOCATION   FileMaker ServerDataScripts
:: PURPOSE    Redirect output of a PowerShell script to log files, when run by FileMaker Server.
:: USAGE      Call this script with a single parameter, which is the name of the script to run.
::            The script to run should be in the same directory as this script.

powershell.exe -file "%~dp0%~1" >>"%~dp0..Documentspowershell_stdout.log" 2>>"%~dp0..Documentspowershell_stderr.log"
Link to comment
Share on other sites

No, FMS does not automatically output the exit status or any errors from script schedules.  You may find something in the event log.  If you need the output then you have to do what you're doing: explicitly have your OS-level script write to a log file.

Link to comment
Share on other sites

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