I am wondering how to finalize the shell command. The current version allows mysqldump output to be packaged in sql.gz and sent via ssh

ssh <server1> "mysqldump -u <user> -p<password> <db> | gzip | ssh <server2> 'cat > /file/path/to/save/filename.sql.gz'"

How to modify it so that it would send not to /file/path/to/save/filename.sql.gz , but via http request to the script?

  • one
  • @Arnial thanks for the answer, I have a problem with the fact that I have a file, and not a small weight. - alias

1 answer 1

The solution to my question is: ssh <server1> "mysqldump -u <user> -p<password> <db> | gzip | curl -X POST -F \"dump=@-\" http://domain/script.php"