#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH DATE=$(date +%Y%m%d) TARGET=/root/my_backup OPT="--opt -c -n -t --skip-triggers" ID="root" PW="1234" DB="mydb" TMP=$TARGET/$DB.$DATE.bak.sql" BAK=$TARGET/$DB.$DATE.bak.tgz" #==( Backup MySQL )======================================= mysqldump -u$ID -P$PW $OPT $DB > $TMP tar -zcf $BAK $TMP rm $TMP exit 0
2011-01-25 11:09
[Shell] backup mysql data by day (note)
訂閱:
張貼留言 (Atom)
0 回應:
張貼留言