Remote backups

Remote backups between two Plixer Scrutinizer instances can be performed by mounting $BACKUPDIR via sshfs. It’s important that the Plixer Scrutinizer versions of the two instances match.

This method assumes a second “destination” host for the backup that has at least enough disk space to contain the backup and that the same version of Plixer Scrutinizer and Postgres have already been installed.

#!/bin/bash
# Set up remote backups between two Scrutinizer instances at the default
# location.

BACKUPDIR=${BACKUPDIR:='/var/db/big/restore'}
REMOTE=YOUR_REMOTE_SCRUTINIZER_INSTANCE

# Install sshfs on both instances
sudo yum -y install sshfs
ssh plixer@$REMOTE "sudo yum -y install sshfs"

# Create the Backup Directory on both instances
sudo mkdir -p $BACKUPDIR
sudo chown plixer:plixer $BACKUPDIR
ssh plixer@$REMOTE "sudo su -c 'mkdir -p $BACKUPDIR && chown plixer:plixer $BACKUPDIR'"

# Allow other users to use FUSE mounts
sudo grep -Eq "^user_allow_other" /etc/fuse.conf || \
sudo sed -i '$ a user_allow_other' /etc/fuse.conf

# Mount the remote instance's backup directory on the local instance
sshfs -o allow_other -o reconnect plixer@$REMOTE:$BACKUPDIR $BACKUPDIR

After the backup is complete, unmount the remote instance.

#!/bin/bash
BACKUPDIR=${BACKUPDIR:='/var/db/big/restore'}
fusermount -u $BACKUPDIR