Devam Ediyor

CURL Shell Script

Hi,

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!

Thanks!

Beceriler: Linux, Kabuk Betiği

Daha fazlasını görün: 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

İşveren Hakkında:
( 1 değerlendirme ) Cardiff, United Kingdom

Proje NO: #713676

Seçilen:

Arenabpo

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

0 gün içinde 50$ USD
(8 Değerlendirme)
3.7