February 4, 201114 yr Please help me with this (small) problem. New to doing shell scripts so sure it's something small Created a shell script and saved it (myfile.sh) in scripts folder. Fixed r/w privileges to fmserver. One line only in myfile.sh: curl http://123.123.123.123/myfolder/sendemail.php FMS returns a invalid command error. If I run it in Terminal it works fine. What am I missing? Thanks, Marco
February 4, 201114 yr Is that 123.123. server the same box or a different one? What does the php page do? Did you also fix the execute privileges?
February 7, 201114 yr Author Fixed the execute but still same error... 2011-02-07 08:11:31.114 +0100 Error 154 BLOOM FMS 10 Schedule "Newsletter Shellscript" aborted; "sendnewsletter.sh" could not be found or is invalid. The php sends emails to selected addresses. Don't understand what you're saying if the server is same box.. Thanks for your help.
February 8, 201114 yr 2011-02-07 08:11:31.114 +0100 Error 154 BLOOM FMS 10 Schedule "Newsletter Shellscript" aborted; "sendnewsletter.sh" could not be found or is invalid. Don't understand what you're saying if the server is same box.. The curl command in your shell script targets an IP address. And since your example didn't use "localhost" or "127.0.0.1" I was asking if the PHP file is on the same box as FMS or on a different box. If it's on a different box, it could be an access privileges issue. The "fmserver" account that drives FMS may not have permissions to touch that file on the remote machine whereas your account does. Which would explain why it runs while you are logged in but not when FMS executes it. "sendnewsletter.sh" could not be found or is invalid. This does look however like the permissions on the shell script itself are not correct. Set "fmserver" as the owner, "fmsadmin" as the group.
February 9, 201114 yr Author @ Wim File is on same machine. Changed ip to localhost. No change. Also changed the shell command no nothing. Same error. I'm sure you're right it has to do with ownership. Changed it to fmserver and fmsadmin. No change. Cant adjust privileges now (-142 chmod failure). What does that indicate? I work in Coda. If I create new file in script folder it has no ownership or privileges. I can't adjust ownership. I can adjust privileges. How do I create a 'fresh' file? So that I'm sure all settings are correct? Thanks for your help!
February 9, 201114 yr Don't know Coda, but just create a new blank text file using text edit and copy/paste the shell script code into that new file. Change the extension to .sh, use Batchmod to set the ownership and group plus the rwx privileges and try to run it manually. If that works, move it into the FMS scripts folder and try with a schedule.
February 9, 201114 yr Author Done exactly what you said. It runs in terminal but not as a schedule in FMS10 Now what?
February 11, 201114 yr Author Still the same: Error 154 BLOOM FMS 10 Schedule "Newsletter Shellscript" aborted; "sendnewsletter.sh" could not be found or is invalid. The PHP file sends emails to selected addresses. Could that be the problem?
February 11, 201114 yr I doubt it. It sounds more like FMS has trouble executing the file. But to make sure: can you replace the shell script (use the same name though) with one that just creates a little text file in the FMS documents folder (FMS has rights to that). That way we would know if the file actually executes. If it does, then it is the code in the shell script that doesn't work.
February 23, 201114 yr we solved this particular user's problem over on FileMaker TechNet by adding a proper hashbang (first line of script: "#!/bin/sh") to the script file
Create an account or sign in to comment