Last active
December 10, 2015 04:08
-
-
Save skyred/4378911 to your computer and use it in GitHub Desktop.
Drupal files and database 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/sh | |
#Set information specific to your site | |
webroot="/srv/www/example.com" | |
db_user="example.com" | |
db_password="XXXXXXXXXXXXXXXX" | |
db_name="example.com" | |
#Set the date and name for the backup files | |
date=`date '+%A'` | |
#Dump the mysql database | |
mysqldump -u $db_user --password="$db_password" $db_name > $webroot/backups/db_backup_$date.sql | |
#Backup Site | |
env GZIP=-9 tar -czpf backups/site_backup_$date.tar.gz public_html/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment