As part of a shell script I’m cooking up, one of the required tasks is to list all currently hosted database files on a Mac OS based FileMaker server. This may get deployed over multiple servers, and I want to keep it as simple and trouble free as possible.
I could’ve easily used:
fmsadmin -u myaccount -p mypassword list files
However, this would require me to edit each copy of the script to include that server’s credentials, update the credentials if they ever changed, and exposing them in my script. At least one alternative when run as the root user is this:
lsof -u fmserver -Fn | grep “.fmp12$” | cut -c 2-
Or, a slightly simpler version that can be run as the fmserver user (on Mac OS, fmserver is the default account used to run system scripts in a FMS Schedule):
lsof -Fn | grep “.fmp12$” | cut -c 2-
Next up is to determine how I can do the same on Windows.
Simon