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 ??
Asked
Active
Viewed 23 times
1 Answers
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