0

I already connected to remote server and exported that dump by this command "mysqldump -u user-p dbname > dump.sql" and now i want to send it through email and all these through SSH ... any help ??

Tito Tito
  • 11
  • 4
  • Possible duplicate of [How do I send a file as an email attachment using Linux command line?](https://stackoverflow.com/questions/17359/how-do-i-send-a-file-as-an-email-attachment-using-linux-command-line) – Mike Doe Jan 18 '19 at 10:51

1 Answers1

0

Just a short one-liner:

ssh host "mysqldump -u user -p dbname >dump.sql &&
gzip -9 dump.sql &&
mailx -s sqldump -a dump.sql.gz recipient@some.domain </dev/null"
JGK
  • 3,710
  • 1
  • 21
  • 26