Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
Last active December 27, 2015 13:38
Show Gist options
  • Save EmmanuelKasper/7334239 to your computer and use it in GitHub Desktop.
Save EmmanuelKasper/7334239 to your computer and use it in GitHub Desktop.
Simple backup of all Virtual Hosts
#!/bin/sh
[ -d /var/backups/vhosts ] || mkdir /var/backups/vhosts
VHOST_DIR=/srv/www/
cd $VHOST_DIR
for VHOST in *; do
if [ "$VHOST" != "basebox.libera.cc" ]; then
tar cpzf /var/backups/vhosts/$VHOST.tar.gz $VHOST
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment