Last active
May 25, 2016 01:50
-
-
Save skyred/aa5949172b3b759bf7e39f5813f0f416 to your computer and use it in GitHub Desktop.
Drupal backup script, using Drush
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="/var/www/html/" | |
#Set the date and name for the backup files | |
date=`date '+%A'` | |
#Dump the mysql database | |
cd $webroot/public_html | |
#Drush needs addtional path in the cron | |
export PATH=$PATH:/usr/local/bin | |
drush cr | |
drush sql-dump --gzip --result-file=../backups/db_backup_$date.sql | |
echo 'Backup has finished for' `date` '!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment