You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by 谭文亮 <wi...@foxmail.com> on 2018/12/17 13:40:16 UTC

How to use the camel-ssh feature to help me manage remote services such as the nginx reload command

I have a need


First I sync the file to the web server via camel-sftp


After transferring the file, do the nginx -s reload command on each server.


My code is as follows


But why pollcomand doesn't work


from("file:I:/workProject/java/xxxx/luaFiles/").multicast().to("direct:a", "direct:b").end().to("direct:c");
        from("direct:a").to("sftp://root@192.168.56.14/xxxx/controllers/gen/?password=root&stepwise=true&runLoggingLevel=TRACE&throwExceptionOnConnectFailed=true&idempotent=true");
        from("direct:b").to("sftp://root@192.168.56.14/?password=root&stepwise=true&runLoggingLevel=TRACE&throwExceptionOnConnectFailed=true&idempotent=true");
        from("direct:c").to("ssh://root:root@192.168.56.14?poll-command=reboot%0A&amp;pollCommand=nginx -s reload %0A").log("done !!${body}");


how to 
please help 
thanks!!!

Re: How to use the camel-ssh feature to help me manage remote services such as the nginx reload command

Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
The pollCommand can be used only on a consumerEndpoint.

So you should have from("ssh://root@192...?pollCommand=reboot%0A")

Also it's pollCommand and not poll-command

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ancosen1985@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Monday, December 17, 2018, 3:09:08 PM GMT+1, 谭文亮 <wi...@foxmail.com> wrote: 





I have a need


First I sync the file to the web server via camel-sftp


After transferring the file, do the nginx -s reload command on each server.


My code is as follows


But why pollcomand doesn't work


from("file:I:/workProject/java/xxxx/luaFiles/").multicast().to("direct:a", "direct:b").end().to("direct:c");
        from("direct:a").to("sftp://root@192.168.56.14/xxxx/controllers/gen/?password=root&stepwise=true&runLoggingLevel=TRACE&throwExceptionOnConnectFailed=true&idempotent=true");
        from("direct:b").to("sftp://root@192.168.56.14/?password=root&stepwise=true&runLoggingLevel=TRACE&throwExceptionOnConnectFailed=true&idempotent=true");
        from("direct:c").to("ssh://root:root@192.168.56.14?poll-command=reboot%0A&amp;pollCommand=nginx -s reload %0A").log("done !!${body}");


how to 
please help 
thanks!!!