= Installation =
The package is called <code>tarsnap</code> on most distributions and is usually included in the official repos. After installation, generate a key and associate it with your Tarnsap account using the following command.
tarsnap-keygen --keyfile /root/tarsnap.key --user firstname.lastname@example.org --machine
= Configuration =
The configuration file is usually stored in <code>/etc/tarsnap.conf</code>. You may need to copy the sample configuration to the
production config before editing. This is what we use but make sure to look at the sample and read the manual before copying and pasting this.
We use [https://github.com/alexjurkiewicz/acts/ ACTS] for automation. It stands for ''Another Calendar-based Tarsnap Script'' and manages backup creation and rotation. It keeps 31 daily backups, 12 monthly backups, and never deletes yearly backups; maintaining those are on you. When you feel like a specific yearly backup is no longer necessary, delete it yourself.
After adding a new user to our database that has read-only access to everything, we'll
configure ACTS, create pre- and post-backup scripts for database dumps, then set up email alerts.
== Database dumps ==
=== Setting PostgreSQL up ===
Same as above but PostgreSQL variant; you'll have to repeat
the GRANT statements after connecting to ''every'' database you want backed up. From what I can tell, there is no way to give a user read-only permission across all PostgreSQL databases.
CREATE ROLE archive WITH LOGIN ENCRYPTED PASSWORD 'CHANGEMETOSOMETHINGSECURE';
# Pick database server, postgres or mysql
== ACTS configuration ==
ACTS can be installed by simply <code>wget</code>ing <code>acts</code> and <code>acts.conf.sample</code> directly from the repo. Alternatively, you can clone the whole repository and symlink <code>acts</code> to wherever you like for easier updates then copy <code>acts.conf.sample</code> to <code>/etc/acts.conf</code>. The following is how we do it.
Make sure you reference the sample configuration file but these are the base options we use. Add additional directories to the <code>backuptargets</code> line, omitting the preceding <code>/</code>. Until you run ACTS and verify that your configuration works properly, leave <code>verbose</code> set to 1. After you're sure everything works, set it to 0. ACTS
expect the config file to be located in <code>/etc/acts.conf</code>