freecheese Posted February 4, 2011 Posted February 4, 2011 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
Wim Decorte Posted February 4, 2011 Posted February 4, 2011 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?
freecheese Posted February 7, 2011 Author Posted February 7, 2011 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.
Wim Decorte Posted February 8, 2011 Posted February 8, 2011 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.
freecheese Posted February 9, 2011 Author Posted February 9, 2011 @ 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!
Wim Decorte Posted February 9, 2011 Posted February 9, 2011 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.
freecheese Posted February 9, 2011 Author Posted February 9, 2011 Done exactly what you said. It runs in terminal but not as a schedule in FMS10 Now what?
Wim Decorte Posted February 9, 2011 Posted February 9, 2011 Are you still getting the "script not found" error or another error?
freecheese Posted February 11, 2011 Author Posted February 11, 2011 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?
Wim Decorte Posted February 11, 2011 Posted February 11, 2011 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.
garbanzito Posted February 23, 2011 Posted February 23, 2011 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
Recommended Posts
This topic is 5020 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 accountSign in
Already have an account? Sign in here.
Sign In Now