Last active
July 17, 2020 11:08
-
-
Save MindaugasR/418661da47cf97fda6e5 to your computer and use it in GitHub Desktop.
PrestaShop full backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Main settings | |
DOMAIN_DIR="/path/to/your/public_html" | |
BACKUP_DIR="/path/to/your/backup" | |
DATE=$(date +%Y-%m-%d) | |
# MySQL Settings | |
DB_HOST="localhost" | |
DB_USER="mysql_username" | |
DB_PASS="mysql_username_password" | |
DB_NAME="mysql_database" | |
[ ! -d "$BACKUP_DIR" ] && mkdir -p $BACKUP_DIR | |
# MySQL Backup | |
mysqldump -u $DB_USER --password=$DB_PASS --opt --databases $DB_NAME | gzip -9 >${BACKUP_DIR}/${DATE}_backup.sql.gz | |
#Files Backup | |
tar cfzP - $DOMAIN_DIR >${BACKUP_DIR}/${DATE}_backup.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment