I have a script that takes a couple of minutes to run, and I pipe the ouput to curl to 'save' the output to an internal ops server. Piping into curl doesn't work as the script is not done and for some reason curl starts the HTTP session with the server and doesn't send the file.

It would be neat to have a flag in curl that 'waited until EOF before starting the HTTP session with the server'.

Problem:
slow_script.pl | curl "-FmyUpload=@-;filename=foo.txt" https://user:[email protected]/upload.php


Work Around:
slow_script.pl | (sleep 60 && curl "-FmyUpload=@-;filename=foo.txt" https://user:[email protected]/upload.php)


Goal:
slow_script.pl | curl "-FmyUpload=@-;filename=foo.txt" --wait-for-eof-for-upload https://user:[email protected]/upload.php


As the years go by, I am sure I'll have to bump the 60 to 120 seconds (or rewrite my script).  with the flag in place, sys admins around the work could put off refactoring shell scripts for years!  Think about all the time saved!


Rudy

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to