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
Vagrant.configure(2) do |config| | |
config.vm.box = 'bento/ubuntu-16.04' | |
config.vm.define "project" | |
config.vm.hostname = "boxname" | |
config.vm.network "forwarded_port", guest: 8000, host: 8000 | |
config.ssh.forward_agent = true | |
# Syncing using NFS and shorten cache life for faster reload |
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 | |
if [ "$HOSTNAME" = "prod-server-name" ]; then | |
echo 'DO NOT RUN ON PRODUCTION!' | |
exit | |
fi | |
# Create backup / transfer it | |
ssh user@prod-server-name 'mysqldump --single-transaction -u www -ppassword database | gzip > database.sql.gz' | |
scp user@prod-server-name:/home/user/database.sql.gz . |