Skip to content

Installation of Backup Server

AlterDepp edited this page Apr 20, 2013 · 6 revisions

configure mail to be delivered to your account

apt-get install mailutils
echo 'root: <username>' >> /etc/aliases
newaliases

configure btrfs file system for data storage

apt-get install btrfs-tools
mkfs.btrfs …
mount … …

configure subvolumes for snapshotting

mkdir data
mkdir snap
mkdir data/common
mkdir snap/common
btrfs subvolume create data/common/share # volume for all shared data
mkdir snap/common/share
mkdir data/user
mkdir snap/user
btrfs subvolume create data/user/<username> # volume for <username>s private data
mkdir snap/user/<username>
mkdir data/host
mkdir snap/host
mkdir data/host/<hostname>
mkdir snap/host/<hostname>
btrfs subvolume create data/host/<hostname>/local # volume for private data of <hostname> (i.e. this script)
mkdir snap/host/<hostname>/local
btrfs subvolume create data/host/<hostname>/<username> # volume for .-dirs for <username> on <hostname>
mkdir snap/host/<hostname>/<username>
…

get scripts for snapshotting

apt-get install git
git config --global user.name "…"
git config --global user.email …
git config --global core.editor …
git clone https://github.com/mmehnert/btrfs-snapshot-rotation
git clone https://github.com/AlterDepp/snapshot-anacron-scripts

configure scripts for snapshotting

vi snapshot-config

configure anacron to do the snapshots

apt-get install anacron
ln -s …/snapshot-daily /etc/cron.daily
ln -s …/snapshot-weekly /etc/cron.weekly
ln -s …/snapshot-monthly /etc/cron.monthly

Now synchronize data i.e. with unison

apt-get install unison