# ************ Example Drush Site Sync Script ************ # Created by Ted Bowman # Learn more at http://www.sixmiletech.com/content/syncing-sites-drush # ******************* # Make sure to replace $1 $2 with your actual site aliases # You can also replace these with $1 and $2 to send the aliases as arguments to this script # Backup development database drush $2 en backup_migrate -y drush $2 bb # Save file system settings private_path=$(drush $2 vget --format=string file_private_path) public_path=$(drush $2 vget --format=string file_public_path) temp_path=$(drush $2 vget --format=string file_temporary_path) # Synch Database drush sql-sync $1 $2 # Restore File system settings drush $2 vset file_private_path $private_path drush $2 vset file_public_path $public_path drush $2 vset file_temporary_path $temp_path # Optional: Disable sending Emails in development drush $2 en maillog -y drush $2 en devel -y drush $2 vset --format=integer maillog_send 0 drush $2 vset --format=integer maillog_devel 1 drush $2 vset --format=integer maillog_log 1 # Optional: Sync Files drush rsync $1:%files/ $2:%files # Clear All Caches on Development drush $2 cc all