<p dir="ltr">You can check curl exitcode. If not zero, then do not delete file</p>
<br><div class="gmail_quote"><div dir="ltr">On Thu, Mar 3, 2016, 13:48 John Nash &lt;<a href="mailto:john.nash778@gmail.com">john.nash778@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>When using XML CDR to resubmit XML CDR I have a shell script which resends XML CDR from error directory again to the web server (As per doc <a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_cdr" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_cdr</a>)<br><br></div>In this script following curl command is doing the trick <br><pre style="margin:10px 0px 0px;padding:0px;color:rgb(51,51,51);font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:20px;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">for CDR in $(find $CDRDIR -name &quot;*.cdr.xml&quot;); do
    echo &quot;Resubmitting $(basename $CDR .cdr.xml)...&quot;
    echo -n &#39;cdr=&#39;$(cat $CDR) | \
        curl -sS -X POST -f --$AUTH_SCHEME -u $CRED -d @- $URL &gt;/dev/null \
            &amp;&amp; echo &quot;OK, removing CDR file&quot; \
            &amp;&amp; rm -f $CDR
done</pre><br></div>My question is how to handle the case when even this submission fails because of any reason?..I want to skip the remove file step in case again some error happens with web server, How can I do that?<br><div><br><br></div></div>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a></blockquote></div>