I want to upload a database backup file into an external ftp server using curl. I use postgres and pg_dump streams the content of file into buffered output. I tried
echo pg_dump dbname| gzip" | curl -d @- ftp://user:pass@host:/pg_dump/$(date +"%Y%m%d%H%M")_dump.gz
but it doesn't work. Any suggestion?