CURL Shell Script


We have a simple shell command like this:

for xmlcdrfile in *.[url removed, login to view]; do curl -X POST --basic -u "UUUUUUU:PPPPPP" -d cdr=$(cat $xmlcdrfile) http://XXXXXXXX; done

which can be run to post files to an app server. It responds normally with a 200 OK. The addition of rm $xmlcdrfile before the done also deletes the file.

However,, if the post is unsuccessful the file gets deleted anyway.

We would like the above modifying so it can be safely run in cron and will only ever delete a file which has been sucesfully posted. In the event of an error, it should pass the file and process the next one.

Very quick job for someone who knows what they're doing with shell!


Habilidades: Linux, Shell Script

Ver más: curl shell script, shell script curl, curl delete script shell, curl shell script post xml, shell script curl post xml, curl shell cron, shell script xml curl, curl shell, curl script, in linux shell script, basic shell script, shell script, Rm, cron script, cron command, cdr, simple cron job linux, script event, run script linux, run command linux, delete file shell script, http command, script process xml file, app cdr, cdr app

Información del empleador:
( 1 comentario ) Cardiff, United Kingdom

Nº del proyecto: #713676

Adjudicado a:


Hello, i am shell export, this project is simple, let me do it for you, thank you!

$50 USD en 0 días
(8 comentarios)