DB Backup script :-

DB Backup script :-

#! /bin/bash
TIMESTAMP=$(date +”%F”)
BACKUP_DIR=/temp/My-Backup-$TIMESTAMP
MYSQL_USER=”your-db-username”
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD=”your-db-username-password”
MYSQLDUMP=/usr/bin/mysqldump
DATABASE=your-db-name
mkdir -p “$BACKUP_DIR/mysql”

$MYSQLDUMP –force –opt –user=$MYSQL_USER -p$MYSQL_PASSWORD $DATABASE | gzip > “$BACKUP_DIR/mysql/$DATABASE.gz”