0

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?

burak emre
  • 1,501
  • 4
  • 22
  • 46

1 Answers1

0

I tried

pg_dumpall | gzip | curl -T ftp://user:pass@host:/pg_dump/$(date +"%Y%m%d%H%M")_dump.gz

and it worked.

burak emre
  • 1,501
  • 4
  • 22
  • 46