#!/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
#!/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