I can run a script that does a copy from the command line but not openhab.
(when sudo is in the script); if sudo is not in the script, i get permission denied.
Rule text has: executeCommandLine(“bash /etc/openhab2/MoveMailBoxSnaps2.sh”)
That script does this; its a file copy to a mounted share
I’ve tried it with sudo as well(this pic has sudo removed)
Its likely the space. If you look at the docs they talk about using “@@” between a binary and its arguments. While you prob don’t think of it like this the “/etc/openhab2/MoveMailBoxSnaps2.sh” part is a argument for the binary “bash”.
If your script has “#!/bin/sh” or equiv at the top and is executable, I’d just remove the “bash” part:
Thanks for the replies tommy and maurits; none of those worked.
I tried adding that line to sudoers and retried the rule; nothing
I tried both ways with the @@ and removing bash, neither worked.
Openhab log says it executes; but it never copies the files(if i run it manually with sudo /etc/openhab2/…sh works fine.
I believe, the combo of removing bash, adding sudo and changing the sudoers as Mauritis suggested(along with maybe a restart of openhab??) got it working