Created
June 28, 2017 19:17
-
-
Save paulsheldrake/f857d394795d1c2d2fd66680e2e45891 to your computer and use it in GitHub Desktop.
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 | |
# Generate the new dump file path | |
now=$(date +"%Y_%m_%d") | |
path="/home/468e/backup/mises.prod.$now.sql" | |
path_gz="/home/468e/backup/mises.prod.$now.sql.gz" | |
# Export the DB, remove old versions of the same file | |
rm -f $path_gz | |
cd /var/www/prod.mises.org/htdocs/; | |
/usr/local/bin/drush sql-dump --gzip --result-file="$path"; | |
# Create symlink to latest | |
path_latest="/home/468e/backup/latest.sql.gz" | |
rm -f $path_latest | |
ln -s $path_gz $path_latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment