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

MaintainerFélix Sipma <>
Safe HaskellNone



Support for the restic backup tool



init :: ResticRepo -> Property (HasInfo + DebianLike) Source #

Inits a new restic repository

restored :: FilePath -> ResticRepo -> Property (HasInfo + DebianLike) Source #

Restores a directory from a restic 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 -> ResticRepo -> Times -> [ResticParam] -> [KeepPolicy] -> Property (HasInfo + DebianLike) Source #

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

	& Restic.backup "/srv/git"
		(Restic.SFTP (User root) (HostName myserver) /mnt/backup/git.restic")
		[Restic.KeepDays 7, Restic.KeepWeeks 4, Restic.KeepMonths 6, Restic.KeepYears 1]

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

backup' :: [FilePath] -> ResticRepo -> Times -> [ResticParam] -> [KeepPolicy] -> Property (HasInfo + DebianLike) Source #

Does a backup, but does not automatically restore.

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