I have this line in crontab:
* * * * * /var/www/dir/sh/mysql_dumb.sh | mail -s "mysql_dump" [email protected]
(every minute only a sample)
So, all works fine, but the email is empty.
UPDATE:
The output from mysql_dumb.sh is a *.sql
file and they save the file in a directory.
How can I send a copy (*.sql file) from this output -> mysql_dumb.sh
to my email?
mysql_dumb.sh:
#!/bin/bash
PATH=/usr/bin:/bin
SHELL=/bin/bash
/usr/bin/mysqldump -u USER -pPASS DATABASE > /var/www/dir/backup/backup_DB_`date +%d_%m_%Y`.sql
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…