bin bash FILENAME mysqldump- date tar gz mysqldump -uroot -hlocalhost

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/bin/bash
FILENAME=mysqldump-`date '+%d%m%y'`.tar.gz
mysqldump -uroot -hlocalhost -pfaeraiyooc -A > /backup/all-databases.sql
tar -cjvf $FILENAME /backup/all-databases.sql
ftp -in <<EOF
open wdc-backup2.ispsystem.net
user ftp2391900 uW3dwDUV
put /backup/$FILENAME /mysql/$FILENAME
ls
bye
EOF
rm -rf /backup/all-databases.sql
rm -rf /backup/$FILENAME