<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Event unix command - do I need special characters quoted]]></title><description><![CDATA[<p dir="auto">I have an event command which works if submitted direct to the command line but comes up with an error when run as an triggered event</p>
<p dir="auto">find /usr/local/tomcat/logs/ -type f -name "*" -mtime +5 -exec rm -f "{}" ;</p>
<p dir="auto">WARN 2010-09-13 00:00:00 (com.serotonin.mango.rt.maint.work.ProcessWorkItem.execute:85) - Process error: 'find: missing argument to '-exec'<br />
'</p>
<p dir="auto">note the additional single inverted comma on the second line.</p>
<p dir="auto">Have I missed any quoting on my unix command</p>
]]></description><link>https://forum.mango-os.com/topic/514/event-unix-command-do-i-need-special-characters-quoted</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 04:57:26 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/514.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Sep 2010 15:32:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Tue, 05 Oct 2010 09:33:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi all</p>
<p dir="auto">I have found a work around - not sure why this works but it does</p>
<p dir="auto">Mango runs as root and when I run the command</p>
<p dir="auto">find /usr/local/tomcat/logs/ -type f -name * -mtime +5 -exec rm -f {} ;</p>
<p dir="auto">I get the error mentioned</p>
<p dir="auto">but when I run it as my user ("francis")</p>
<p dir="auto">sudo -u francis find /usr/local/tomcat/logs/ -type f -name * -mtime +5 -exec rm -f {} ;</p>
<p dir="auto">then this works</p>
<p dir="auto">it must be something to do with privileges etc - but I do not know why</p>
<p dir="auto">Francis</p>
]]></description><link>https://forum.mango-os.com/post/4532</link><guid isPermaLink="true">https://forum.mango-os.com/post/4532</guid><dc:creator><![CDATA[fclauson]]></dc:creator><pubDate>Tue, 05 Oct 2010 09:33:40 GMT</pubDate></item><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Thu, 16 Sep 2010 19:58:46 GMT]]></title><description><![CDATA[<p dir="auto">Try removing /usr/local/tomcat/.</p>
<p dir="auto">In my experience when Mango runs a command line it does it as the tomcat user which it's home directory is tomcat so I think it would work as this</p>
<p dir="auto">find logs/ -type f -name * -mtime +5 -exec rm -f {} ;</p>
<p dir="auto">I haven't tried it but it might help.</p>
<p dir="auto">Joel.</p>
]]></description><link>https://forum.mango-os.com/post/4360</link><guid isPermaLink="true">https://forum.mango-os.com/post/4360</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Thu, 16 Sep 2010 19:58:46 GMT</pubDate></item><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Thu, 16 Sep 2010 03:22:54 GMT]]></title><description><![CDATA[<p dir="auto">This works for me:</p>
<pre><code>find /usr/local/tomcat/logs/ -type f -name * -mtime +5 -exec rm -f {} ;
</code></pre>
<p dir="auto">I.e. take out the dquotes and the ''.</p>
]]></description><link>https://forum.mango-os.com/post/4356</link><guid isPermaLink="true">https://forum.mango-os.com/post/4356</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Thu, 16 Sep 2010 03:22:54 GMT</pubDate></item><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Wed, 15 Sep 2010 15:59:57 GMT]]></title><description><![CDATA[<p dir="auto">Nope - none of the above worked</p>
<p dir="auto">Need to have a further play - convinced its a quoting type problem - but if any one can get it to work please let me know</p>
<p dir="auto">Francis</p>
]]></description><link>https://forum.mango-os.com/post/4332</link><guid isPermaLink="true">https://forum.mango-os.com/post/4332</guid><dc:creator><![CDATA[fclauson]]></dc:creator><pubDate>Wed, 15 Sep 2010 15:59:57 GMT</pubDate></item><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Mon, 13 Sep 2010 18:48:17 GMT]]></title><description><![CDATA[<p dir="auto">No idea whether this will work, but maybe try a "\" instead of ""?</p>
]]></description><link>https://forum.mango-os.com/post/4298</link><guid isPermaLink="true">https://forum.mango-os.com/post/4298</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Mon, 13 Sep 2010 18:48:17 GMT</pubDate></item><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Mon, 13 Sep 2010 18:18:08 GMT]]></title><description><![CDATA[<p dir="auto">I don't see any unusually-named files in that listing, which was my first guess.  I can reproduce the error message by embedding a carriage return in the command immediately before the ;.  For example:</p>
<p dir="auto">$ find . -type "*" -exec ls -l "{}"^M;<br />
find: missing argument to '-exec'</p>
<p dir="auto">(I inserted the ^M by typing ctrl-V&lt;CR&gt;.)  So my next guess is that you have a hidden carriage return or non-printable character in the command itself.</p>
]]></description><link>https://forum.mango-os.com/post/4297</link><guid isPermaLink="true">https://forum.mango-os.com/post/4297</guid><dc:creator><![CDATA[SteveE]]></dc:creator><pubDate>Mon, 13 Sep 2010 18:18:08 GMT</pubDate></item><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Mon, 13 Sep 2010 17:09:28 GMT]]></title><description><![CDATA[<p dir="auto">Steve - thanks - this is what I have</p>
<p dir="auto">francis@automaiton1:~$ ls /usr/local/tomcat/logs/<br />
catalina.2010-09-11.log  catalina.out.8               mango.log2010-09-05<br />
catalina.2010-09-12.log  catalina.out.9               mango.log2010-09-06<br />
catalina.out             host-manager.2010-09-11.log  mango.log2010-09-07<br />
catalina.out.1           host-manager.2010-09-12.log  mango.log2010-09-08<br />
catalina.out.2           localhost.2010-09-11.log     mango.log2010-09-09<br />
catalina.out.3           localhost.2010-09-12.log     mango.log2010-09-10<br />
catalina.out.4           localhost.2010-09-13.log     mango.log2010-09-11<br />
catalina.out.5           manager.2010-09-11.log       mango.log2010-09-12<br />
catalina.out.6           manager.2010-09-12.log<br />
catalina.out.7           mango.log</p>
]]></description><link>https://forum.mango-os.com/post/4294</link><guid isPermaLink="true">https://forum.mango-os.com/post/4294</guid><dc:creator><![CDATA[fclauson]]></dc:creator><pubDate>Mon, 13 Sep 2010 17:09:28 GMT</pubDate></item><item><title><![CDATA[Reply to Event unix command - do I need special characters quoted on Mon, 13 Sep 2010 15:55:48 GMT]]></title><description><![CDATA[<p dir="auto">I believe that apostrophe on the second line matches the one on the first line before the word "find":</p>
<p dir="auto">...Process error: 'find: missing argument to '-exec'<br />
^<br />
What does the contents of the directory look like (ls or ls -l)?</p>
]]></description><link>https://forum.mango-os.com/post/4293</link><guid isPermaLink="true">https://forum.mango-os.com/post/4293</guid><dc:creator><![CDATA[SteveE]]></dc:creator><pubDate>Mon, 13 Sep 2010 15:55:48 GMT</pubDate></item></channel></rss>