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

Safe Haskell | None
Language | Haskell98

Propellor.Property.Obnam

Description

Deprecated: Obnam has been retired; time to transition to something else

Support for the Obnam backup tool http://obnam.org/

This module is deprecated because Obnam has been retired by its author.

Synopsis

- type ObnamParam = String
- data NumClients
  - = OnlyClient
  - | MultipleClients
- backup :: FilePath -> Times -> [ObnamParam] -> NumClients -> Property DebianLike
- backupEncrypted :: FilePath -> Times -> [ObnamParam] -> NumClients -> GpgKeyId -> Property (HasInfo + DebianLike)
- backup' :: FilePath -> Times -> [ObnamParam] -> NumClients -> Property DebianLike
- restored :: FilePath -> [ObnamParam] -> Property DebianLike
- data KeepPolicy
  - = KeepHours Int
  - | KeepDays Int
  - | KeepWeeks Int
  - | KeepMonths Int
  - | KeepYears Int
- keepParam :: [KeepPolicy] -> ObnamParam
- isKeepParam :: ObnamParam -> Bool
- installed :: Property DebianLike

# Documentation

type ObnamParam = String Source #

data NumClients Source #

An obnam repository can be used by multiple clients. Obnam uses locking to allow only one client to write at a time. Since stale lock files can prevent backups from happening, it's more robust, if you know a repository has only one client, to force the lock before starting a backup. Using OnlyClient allows propellor to do so when running obnam.

Constructors

OnlyClient |
MultipleClients |

Instances

Eq NumClients Source # |
Instance details Defined in Propellor.Property.Obnam Methods (==) :: NumClients -> NumClients -> Bool (/=) :: NumClients -> NumClients -> Bool

backup :: FilePath -> Times -> [ObnamParam] -> NumClients -> Property DebianLike Source #

Installs a cron job that causes a given directory to be backed up, by running obnam 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:

    	& Obnam.backup "/srv/git" "33 3 * * *"
    		[ "--repository=sftp://2318@usw-s002.rsync.net/~/mygitrepos.obnam"
    		] Obnam.OnlyClient
    		`requires` Ssh.keyImported SshRsa "root" (Context hostname)

How awesome is that?

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

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

backupEncrypted :: FilePath -> Times -> [ObnamParam] -> NumClients -> GpgKeyId -> Property (HasInfo + DebianLike) Source #

Like backup, but the specified gpg key id is used to encrypt the repository.

The gpg secret key will be automatically imported into root's keyring using Propellor.Property.Gpg.keyImported

backup' :: FilePath -> Times -> [ObnamParam] -> NumClients -> Property DebianLike Source #

Does a backup, but does not automatically restore.

restored :: FilePath -> [ObnamParam] -> Property DebianLike Source #

Restores a directory from an obnam 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.

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 obnam's man page for details.

Constructors

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

keepParam :: [KeepPolicy] -> ObnamParam Source #

Constructs an ObnamParam that specifies which old backup generations to keep. By default, all generations are kept. However, when this parameter is passed to the `backup` or `backupEncrypted` properties, they will run obnam forget to clean out generations not specified here.

isKeepParam :: ObnamParam -> Bool Source #

installed :: Property DebianLike Source #