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?
I tried
pg_dumpall | gzip | curl -T ftp://user:pass@host:/pg_dump/$(date +"%Y%m%d%H%M")_dump.gz
and it worked.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.