Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- SOURCE=$1
- DEST=$2
- if [[ -z "$SOURCE" ]]; then
- read -p "Source Environment: " SOURCE
- fi
- if [[ -z "$DEST" ]]; then
- read -p "Destination Environment: " DEST
- fi
- DATE=`date +%Y-%m-%d_%H%M`
- echo "Drush commands using Source: ${SOURCE} and Destination: ${DEST}"
- drush use ${DEST} && drush sql-dump --result-file=~/Downloads/Project\ Backups/My\ Project/local/${DATE}.sql && drush sql-drop -y && drush sql-sync ${SOURCE} ${DEST} -y && drush rr && drush fra -y --force && drush updb -y
- # You can comment this line out if you do not want to run rsync between the environments
- drush rsync ${SOURCE}:%files/ ${DEST}:%files
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement