Skip to content

Instantly share code, notes, and snippets.

@charego
Created November 24, 2020 06:39
Show Gist options
  • Save charego/f4249f26c09938f88995436c395f2a79 to your computer and use it in GitHub Desktop.
Save charego/f4249f26c09938f88995436c395f2a79 to your computer and use it in GitHub Desktop.
Backup NGINX/webserver config
#!/bin/bash
SCRIPT_DIR=$( cd "$( dirname "$0" )" && pwd )
USER=charles
HOST=gould.dev
echo "Backing up nginx config..."
mkdir -p "${SCRIPT_DIR}/etc/nginx/"
rsync -azv ${USER}@${HOST}:/etc/nginx/ etc/nginx/
echo "Backing up web root..."
mkdir -p "${SCRIPT_DIR}/var/www/"
rsync -azv ${USER}@${HOST}:/var/www/ var/www/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment