Skip to content

Instantly share code, notes, and snippets.

rap2hpoutre /
Last active Mar 15, 2021
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
samhernandez / mysqlsync
Last active Mar 4, 2021
Sync remote mysql database to local over ssh
View mysqlsync
# This script assumes you have ssh access to a remote server
# Both databases are backed up to sql files in the same directory
# this script is executed from.
# Usage:
# 1. Make sure this file is executable with `chmod +x mysqlsync`
# 2. Set the credentials for the variables at the top
# (Remember, no spaces around the '=' sign)
# 3. Run it from a directory where you'd like the backup files to go: