backup database

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/sh
MYSQLDUMP="/usr/local/bin/mysqldump"
cd /tmp
rm -rf web_backup
mkdir web_backup
cd web_backup
$MYSQLDUMP first_db > first_db.sql
$MYSQLDUMP second_db > second_db.sql
$MYSQLDUMP third_db > third_db.sql
cp -r /usr/local/etc/nginx .
cp -r /etc/namedb .
cp -r /var/trac .
tar zcf web_backup.tgz *