Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Complete backup of all domains to strongspace (See related posts)

# comprehensive TextDrive backup to Strongspace
# Joel Dueck (
# This script will backup all websites in your TextDrive account to Strongspace.
#         1. Save this script into your home dir,  chmod it to 700 for security
# 2. Create a pair of ssh keys; install the public key on your strongspace account and the private one in ~/.ssh
# 3. Change the configuration variables below

## Configuration section
#  [Don't forget trailing slashes for all directories!]


        # Optional: Enter the path in your TextDrive account where your database backups are stored.
        # If found, this directory will be rsync'd to strongspace separately. If this folder does not exist then 
        # this feature will be ignored.
        # For a cron job that will create daily rolling MySQL backups, see

        STRONGSPACE_KEY=/home/YOURUSERNAME/.ssh/ss             # Private key file
        STRONGSPACE_USER=SSUSER                                  # Your strongspace login name          # Your strongspace domain

        STRONGSPACE_WEB_BACKUP_DIR=private/backup/web/               # strongspace path for storing web file backups
        STRONGSPACE_DB_BACKUP_DIR=private/backup/databases/  # optional strongspace path for storing SQL backups
## End of configuration section

DOMAINS=`ls ~/domains`
for dom in $DOMAINS
        /usr/local/bin/rsync -azq --delete -e "ssh -i $STRONGSPACE_KEY" ~/domains/$dom/public_html/ $STRONGSPACE_USER@$STRONGSPACE_DOMAIN:/home/$STRONGSPACE_USER/$STRONGSPACE_WEB_BACKUP_DIR/$dom

if [ -d ~/public_html ]; then
        /usr/local/bin/rsync -azq --delete -e "ssh -i $STRONGSPACE_KEY" ~/public_html/ $STRONGSPACE_USER@$STRONGSPACE_DOMAIN:/home/$STRONGSPACE_USER/$STRONGSPACE_WEB_BACKUP_DIR/$dom

if [ -d $DB_BACKUP_DIR ]; then

You need to create an account or log in to post comments to this site.

Related Posts