Skip to content

localbackup

Automatically backups current machine to local directory.

Usage

To use this module, import it like this:

{config, lib, inputs, ...}: {
    imports = [ inputs.clan-core.clanModules.localbackup ];
    # ...
}

Module Options

clan.localbackup.snapshots

Number of snapshots to keep

Type: signed integer

Default:

20

localbackup

clan.localbackup.targets

List of directories where backups are stored

Type: attribute set of (submodule)

Default:

{ }

localbackup

clan.localbackup.targets.<name>.directory

the directory to backup

Type: string

localbackup

clan.localbackup.targets.<name>.mountpoint

mountpoint of the directory to backup. If set, the directory will be mounted before the backup and unmounted afterwards

Type: null or string

Default:

null

localbackup

clan.localbackup.targets.<name>.name

the name of the backup job

Type: string matching the pattern ^[a-zA-Z0-9._-]+$

Default:

"‹name›"

localbackup

clan.localbackup.targets.<name>.postBackupHook

Shell commands to run after the backup

Type: null or strings concatenated with "\n"

Default:

null

localbackup

clan.localbackup.targets.<name>.postMountHook

Shell commands to run after the directory is mounted

Type: null or strings concatenated with "\n"

Default:

null

localbackup

clan.localbackup.targets.<name>.postUnmountHook

Shell commands to run after the directory is unmounted

Type: null or strings concatenated with "\n"

Default:

null

localbackup

clan.localbackup.targets.<name>.preBackupHook

Shell commands to run before the backup

Type: null or strings concatenated with "\n"

Default:

null

localbackup

clan.localbackup.targets.<name>.preMountHook

Shell commands to run before the directory is mounted

Type: null or strings concatenated with "\n"

Default:

null

localbackup

clan.localbackup.targets.<name>.preUnmountHook

Shell commands to run before the directory is unmounted

Type: null or strings concatenated with "\n"

Default:

null

localbackup