越简单越好!

Remote database backup script

发表于 2009-07-24 15:06 | 1381次阅读 0次点赞   Linux

#!/bin/bash
BACKUP_DIR=/backup/
DAY=`date +%d`

mkdir -p $BACKUP_DIR/$DAY/

mysqldump -u root -ppassword database > $BACKUP_DIR/$DAY/dump.sql

cd $BACKUP_DIR/$DAY/

gzip dump.sql

返回顶部 ^