hanneseichblatt.de About Pages Tags Contact RSS

Install Tarsnap on CentOS 7

27 September 2015

To use the excellent Tarsnap online backup service on a CentOS 7 system, follow these steps:

cd /usr/src/
wget https://www.tarsnap.com/download/tarsnap-autoconf-
tar xf tarsnap-autoconf- 
wget https://www.tarsnap.com/download/tarsnap-sigs-
cat tarsnap-sigs- 
sha256sum -c tarsnap-sigs-
cd tarsnap-autoconf-
yum install gcc e2fsprogs-devel zlib-devel openssl-devel 
make install
cp /usr/local/etc/tarsnap.conf.sample /usr/local/etc/tarsnap.conf

Edit /usr/local/etc/tarsnap.conf. Then create a key:

/usr/local/bin/tarsnap-keygen --keyfile /root/tarsnap.key --user YOUR_USER_ID --machine MACHINE_ID

Copy the key to a safe location, otherwise you cannot access the backup data in case of loss of this key.

Create cronjobs like this one:

@daily  /usr/local/bin/tarsnap -c -f my-root-server-$(date +\%Y\%m\%d) /var/lib/mysql /home /etc /var/log