Commit Graph

15 Commits

Author SHA1 Message Date
Tanner Doshier
ab1008014d tarsnap: 1.0.36.1 -> 1.0.37 2016-03-14 17:56:48 -05:00
Austin Seipp
7a01badef5 nixos: tarsnap - allow keys for individual archives
Two concurrent tarsnap backups cannot be run at the same time with the
same keys - completely separate sets of keys must be generated for each
archive in this case, if you want backups to overlap.

This extends the archives attrset to support a 'keyfile' option, which
defaults to /root/tarsnap.key like the top-level attribute.

With this change, if you generate two keys with tarsnap-keygen(1) and
use each of those separately for each archive, you can backup
concurrently.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2016-01-07 05:54:41 -06:00
Austin Seipp
ec70f64ecd nixos: tarsnap - separate archive cachedirs
Tarsnap locks the cachedir during backup, meaning if you specify
multiple backups with a shared cache that might overlap (for example,
one backup may take an hour), secondary backups will fail. This isn't
very nice behavior for the obvious reasons.

This splits the cache dirs for each archive appropriately. Note that
this will require a rebuild of your archive caches (although if you were
only using one archive for your whole system, you can just move the
directory).

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2016-01-07 05:54:36 -06:00
Tanner Doshier
ad796f155b nixos: tarsnap - make systemd timer persistent
A machine may not always be active (or online!) when a backup timer
triggers, meaning backups can be missed - now we properly set the
tarsnap timer's Persistent option so systemd will run the command even
when the machine wasn't online at that exact time.

However, we also need to make sure that we can contact the tarsnap
server reliably before we start the backup. So, we attempt to ping the
access endpoint in a loop with a sleep, before continuing.

This fixes #8823.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2016-01-07 05:52:18 -06:00
Austin Seipp
472a5192fd Revert "nixos: tarsnap - separate archive cachedirs"
This reverts commit 5f0253ace6.

I didn't intend to push this - I meant to push it to *my fork's*
remote...
2016-01-07 04:51:58 -06:00
Austin Seipp
5f0253ace6 nixos: tarsnap - separate archive cachedirs
Tarsnap locks the cachedir during backup, meaning if you specify
multiple backups with a shared cache that might overlap (for example,
one backup may take an hour), secondary backups will fail. This isn't
very nice behavior for the obvious reasons.

This splits the cache dirs for each archive appropriately. Note that
this will require a rebuild of your archive caches (although if you were
only using one archive for your whole system, you can just move the
directory).

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2016-01-07 04:26:57 -06:00
Aristid Breitkreuz
5ccbfb2dcc tarsnap: fix up permissions of existing cache directories 2015-05-04 18:58:35 +00:00
Joachim Fasting
66bfc3bbe6 tarsnap module: add options for controlling bandwidth
Annoyingly, these do not appear to accept SI prefixes.
2015-04-04 12:03:02 +02:00
Joachim Fasting
7cb7c57132 tarsnap module: inline optionalNullStr 2015-04-04 11:34:37 +02:00
Joachim Fasting
1bdd12ed69 nixos: refactor tarsnap backup service module
Major changes
- Port to systemd timers: for each archive configuration is created a
  tarsnap@archive-name.timer which triggers the instanced service unit
- Rename the `config` option to `archives`

Minor/superficial improvements
- Restrict tarsnap service capabilities
- Use dirOf builtin
- Set executable bit for owner of tarsnap cache directory
- Set IOSchedulingClass to idle
- Humanize numbers when printing stats
- Rewrite most option descriptions
- Simplify assertion
2015-03-10 12:35:58 +01:00
Austin Seipp
9242ed1fe2 nixos: refactor tarsnap module
The Tarsnap module is now far more flexible, allowing individual
archives with individual options to be specified at will, allowing
granular backup schedules, etc.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-04-28 18:15:16 -05:00
Eelco Dolstra
29027fd1e1 Rewrite ‘with pkgs.lib’ -> ‘with lib’
Using pkgs.lib on the spine of module evaluation is problematic
because the pkgs argument depends on the result of module
evaluation. To prevent an infinite recursion, pkgs and some of the
modules are evaluated twice, which is inefficient. Using ‘with lib’
prevents this problem.
2014-04-14 16:26:48 +02:00
Austin Seipp
881bb235d9 nixos: tarsnap module documentation updates
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-03-08 08:00:56 -06:00
Domen Kozar
10787951ab tarsnap: mention getting started page 2014-03-07 15:37:09 +01:00
Austin Seipp
24cf6afa05 nixos: add Tarsnap backup service module
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-03-07 15:37:09 +01:00