propellor-5.17: property-based host configuration management in haskell

Maintainer | Félix Sipma <felix+propellor@gueux.org>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Propellor.Property.Attic

Description

Deprecated: Use Borg instead

Support for the Attic backup tool https://attic-backup.org/

This module is deprecated because Attic is not available in debian stable any longer (so the installed property no longer works), and it appears to have been mostly supersceded by Borg.

Synopsis

- installed :: Property DebianLike
- repoExists :: AtticRepo -> IO Bool
- init :: AtticRepo -> Property DebianLike
- restored :: FilePath -> AtticRepo -> Property DebianLike
- backup :: FilePath -> AtticRepo -> Times -> [AtticParam] -> [KeepPolicy] -> Property DebianLike
- data KeepPolicy
  - = KeepHours Int
  - | KeepDays Int
  - | KeepWeeks Int
  - | KeepMonths Int
  - | KeepYears Int

# Documentation

installed :: Property DebianLike Source #

repoExists :: AtticRepo -> IO Bool Source #

init :: AtticRepo -> Property DebianLike Source #

Inits a new attic repository

restored :: FilePath -> AtticRepo -> Property DebianLike Source #

Restores a directory from an attic backup.

Only does anything if the directory does not exist, or exists, but is completely empty.

The restore is performed atomically; restoring to a temp directory and then moving it to the directory.

backup :: FilePath -> AtticRepo -> Times -> [AtticParam] -> [KeepPolicy] -> Property DebianLike Source #

Installs a cron job that causes a given directory to be backed up, by running attic with some parameters.

If the directory does not exist, or exists but is completely empty, this Property will immediately restore it from an existing backup.

So, this property can be used to deploy a directory of content to a host, while also ensuring any changes made to it get backed up. For example:

    	& Attic.backup "/srv/git" "root@myserver:/mnt/backup/git.attic" Cron.Daily
    		["--exclude=/srv/git/tobeignored"]
    		[Attic.KeepDays 7, Attic.KeepWeeks 4, Attic.KeepMonths 6, Attic.KeepYears 1]

Note that this property does not make attic encrypt the backup repository.

Since attic uses a fair amount of system resources, only one attic backup job will be run at a time. Other jobs will wait their turns to run.

data KeepPolicy Source #

Policy for backup generations to keep. For example, KeepDays 30 will keep the latest backup for each day when a backup was made, and keep the last 30 such backups. When multiple KeepPolicies are combined together, backups meeting any policy are kept. See attic's man page for details.

Constructors

KeepHours Int |
KeepDays Int |
KeepWeeks Int |
KeepMonths Int |
KeepYears Int |