#!/bin/bash
FILES_DIR="/var/www"
BACKUP_DIR="/mnt/backup"
TIMESTAMP=`date +"%Y-%m-%d_%H-%M-%S"`
mount $BACKUP_DIR
mysqldump -uroot -hlocalhost -pSuper2021 --all-databases > $BACKUP_DIR/$TIMESTAMP.sql
tar -czvf $BACKUP_DIR/$TIMESTAMP.tar.gz $FILES_DIR/
umount $BACKUP_DIR
exit 0;