softasap.sa-tarsnap
sa-tarsnap
Tarsnap is a safe online backup service for UNIX systems like BSD, Linux, and OS X. It was created in 2008 by Colin Percival. Tarsnap encrypts and saves your data on Amazon S3. It's designed to be efficient, meaning it only uploads and saves data that has changed since your last backup. Only you know the security keys. The service was developed and tested with help from bug-hunters to spot any weaknesses. A serious issue was found during this testing and was addressed in 2011.
Example of Usage (All settings are optional)
Simple
roles:
- {
role: "sa-tarsnap"
}
Advanced:
roles:
- {
role: "sa-tarsnap",
tarsnap_version: "1.0.37"
}
Basic Tarsnap Usage
Create a key if you don't have one:
tarsnap-keygen --keyfile ~/tarsnap.key --user [email protected] --machine mypc
Backup Script: tarsnap_backup.sh
#!/bin/bash
/usr/local/bin/tarsnap -P -c --cachedir ~/cache/ --keyfile ~/tarsnap.key -f "$(uname -n)-$(date +%Y-%m-%d_%H-%M-%S)" data
Restore Script: tarsnap_restore.sh
#!/bin/bash
ARCHIVE=${1}
TARGET_DIR=${2-.}
mkdir -p $TARGET_DIR
tarsnap --cachedir ~/cache/ --keyfile ~/tarsnap.key -p -x -f $ARCHIVE -C $TARGET_DIR
List Archives Script: tarsnap_list.sh
#!/bin/bash
/usr/local/bin/tarsnap --cachedir ~/cache/ --keyfile ~/tarsnap.key --list-archives | sort
Delete Archive by Name Script: tarsnap_delete.sh
#!/bin/bash
ARCHIVE=${1-do-galaxy-2016-11-14_16-59-26}
tarsnap --cachedir ~/cache/ --keyfile ~/tarsnap.key -d -f $ARCHIVE
Delete All Archives Associated with Key Script: tarsnap_nuke.sh
#!/bin/bash
tarsnap --cachedir ~/cache/ --keyfile ~/tarsnap.key --nuke
Copyright and License
Copyright 2016 - Vyacheslav Voronenko
The code is licensed under the BSD 3 clause or the MIT License.
Stay updated with role information on FB
Tarsnap is a secure online backup service for UNIX-like operating systems, including BSD, Linux and OS X
ansible-galaxy install softasap.sa-tarsnap