Jump to content

Testing if file exist when running on server


Recommended Posts

I am planning to start using "Perform Script On Server" and I wrote a very simple script.

The file being verified is on a SD card named NX5U.

The script always return that the "/Volumes/NX5U/abcD.mov is not mounted" and it's not the case.

Would someone know why?

 

Thanks!

 

isRunningOnServer FUNCTION.png

TestingFMServer.pdf

Link to post
Share on other sites

We can't see what that custom function is that checks to see if the file is there.  In general though when you execute anything through server (a schedule or PSoS) then it is the account that runs the FMS processes that will dictate what rights and privileges it has on the OS to do what is being asked.  Given that you are on macOS, the fmsadmin user only has rights to its own folders, it has no rights elsewhere in the OS.

 

Link to post
Share on other sites

This script is being executed when the user has certified a file can be delivered to a customer.

At the moment, I am only trying to get a Perform Script On Server (PSoS) to execute the "CheckWetherFileExist" scriptmaster function. 

 

In my process there are operations which are time consuming when being performed on the FM client. Since, I do not have to wait for the process to complete I want to use PSoS on FM Server.

One of my main process is copying selected files from a NAS to a WebDav structure. For example :

Copy input: "/Volumes/Data/ZVinformatique/videofile.mp4

To output : "/Volumes/Anonymous WebDav/yCaSTifQjUUjdEfs.mp4

 

"Given that you are on macOS, the fmsadmin user only has rights to its own folders, it has no rights elsewhere in the OS."

Does this mean since the Input and the Output file are not part of the fmsadmin user structure copying files with scriptmaster would then not be possible? If so, what are my options? This is a major problem for me.

 

Thanks again?

 

Link to post
Share on other sites

Just to confirm: that SD card is mounted on the server, right?  Not on the user's machine.

Which is odd from a workflow and security point of view because it requires people to be inserting SD cards onto a machine that should be left alone; it's a bit of a security / stability issue if people can just walk up to the server and do things to it.

Link to post
Share on other sites

The SD card is indeed inserted on the server, not the client. I am using a SD card as an example to demonstrate myself I would be able to use scriptmaster functions in PSoP.

In reality, everything as mentioned in the previous post will be done through a NAS (Synology).

Both the server and the NAS are to be located in an area with limited access.

I've started in going with a SD card since access requires /Volumes/.. which is the same requirement for accessing files on a NAS.

I am doing those experiment to make sure I can get things going. When scriptmaster functions in PSoP are confirmed to be working I will be going in much deeper programming.

Thanks again for your help, this is greatly appreciated.

Link to post
Share on other sites

In that case, make sure that the FMS user account has the proper privileges on your volume.  Use Chown and Chmod, not Finder.

Link to post
Share on other sites

Should I create an account “fmsadmin” on the MacMini where FMserver has been installed.

Then from there I would need to ensure using the chmod command the correct privileges are set on the NAS, SD card or any folders the scriptmaster functionS would be executed.

Does that make sense?

 

Thanks.  

Link to post
Share on other sites
Posted (edited)

I've looked at the privileges and it's all rwe.

When a script is executed from a PSoP I was expecting to have the Filemaker Account Name equal to fmserver or fmsadmin. It's not, it's equal to the script name "TestingFMServer" followed by "Daniel Paquin" followed by a number which increase each time the script is being executed.

I do not understand why.

The PSoP script seems to be working fine when looking at the report. However, the return message indicates that the "abcD.mov" file does not exist when it does.

Many thanks!

 

NX5U privilege.png

 

TestingFMServer.pdf

FMS MESSAGE.png

Edited by DPaquin
Link to post
Share on other sites

I'm afraid you're mixing a few things up:

 

1 hour ago, DPaquin said:

When a script is executed from a PSoP I was expecting to have the Filemaker Account Name equal to fmserver or fmsadmin. It's not, it's equal to the script name "TestingFMServer" followed by "Daniel Paquin" followed by a number which increase each time the script is being executed.

I'm assuming you are referring to what you see in the admin console as connected users.  That's just informational.  The PSoS script gets executed with the same privileges as the actual user's account.

But that FM account is totally irrelevant for what you want to do.  What you try to do is have an FMS process reach out to the OS, in effect going outside of FM itself.  When that happens the OS sees the OS account that runs the FMS process, not the internal FM account.

To troubleshoot this properly: first put the mov file in the FMS documents folder and then make sure that your script actually works correctly.  If it doesn't then you still have some script issues to solve before you can tackle the permissions issues.

Link to post
Share on other sites

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.