-
-
Save dave-lw/14e50a0a5d1881726ef20eb054a56def to your computer and use it in GitHub Desktop.
PrestaShop full backup script
This file contains 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