Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Tarsnap install
# Author: Jonas Lejon <>
# 2014-05-30 For Ubuntu
# Usage:
# ./ <tarsnap-email>
if [ -z "$1" ]
echo "No argument supplied"
exit 1
sudo apt-get install -y curl libssl-dev zlib1g-dev e2fslibs-dev build-essential
curl -o tarsnap-autoconf-1.0.37.tgz
curl -o tarsnap-sigs-1.0.37.asc
curl -o tarsnap-signing-key.asc
gpg --import tarsnap-signing-key.asc
gpg --decrypt tarsnap-sigs-1.0.37.asc
echo - "SHA256: "
sha256sum tarsnap-autoconf-1.0.37.tgz
read -p "Do the SHA256 checksum match above? (y/n) " RESP
if [ "$RESP" = "n" ]; then
exit 2
tar xvfz tarsnap-autoconf-1.0.37.tgz
cd tarsnap-autoconf-1.0.37
sudo make install
sudo mkdir /usr/local/tarsnap-cache
sudo tarsnap-keygen --keyfile /root/tarsnap.key --user $1 --machine `hostname`
sudo chmod 600 /root/tarsnap.key
sudo cp /usr/local/etc/tarsnap.conf.sample /usr/local/etc/tarsnap.conf
## Append some extras to the conf
echo "exclude access.log" | sudo tee -a /usr/local/etc/tarsnap.conf
echo "exclude error.log" | sudo tee -a /usr/local/etc/tarsnap.conf
echo "humanize-numbers" | sudo tee -a /usr/local/etc/tarsnap.conf
echo "Don't forget to take a copy of /root/tarsnap.key and store it somewhere really safe!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.