executeCommandLine - CURL


i am trying to write a rule to take a picture from my doorphone by motion.
Unfortunately it don’t work with this commands:

rule "take pic on motion"
    Item OA_Gateway_MotionTest received update 
    val url = ""
    val outputFile = "/home/user/Downloads/" + now.toString.replaceAll("[:\\/ ]+", "_") + ".jpg"
    var cmd = "curl -m 10 -o " + outputFile + " " + url
    logInfo("MotionRule", cmd)

The Log writes the right command (checked on commandLine itself)
Is there any hint with executeCommandLine with curl?

best regards

val results = executeCommandLine(cmd)
logInfo("MotionRule", cmd + results)

It’s often a permissions issue

Check the permission of the directory /home/user/Downloads/. E.g. with the command

ls -ld /home/user/Downloads

Is it writeable for the user that is owning the process openhab software is running under ( user openhab ) ?


thx for the fast reply …
It works now with the hint from @rossko57

The permissions issue was my first idea, tbh, i don’t know , why rosskos57’s hint works …

but thanks to you

It’s not a fix, just reports error messages that you might not have seen.

You’v done something else to “fix” it.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.