Automatically backups current machine to local directory or a mounted drive.
Enable the localbackup service and configure backup targets:
instances = {
localbackup = {
module.name = "@clan/localbackup";
module.input = "self";
roles.default.machines."machine".settings = {
targets.external= {
directory = "/mnt/backup";
mountpoint = "/mnt/backup";
};
};
};
}; The service provides these commands:
localbackup-create: Create a new backuplocalbackup-list: List available backupslocalbackup-restore: Restore from backup (requires NAME and FOLDERS environment variables)The localbackup service has the following roles:
default roleNumber of snapshots to keep
Type: signed integer
Default:
20 Declared in: clanServices/localbackup/default.nix
List of directories where backups are stored
Type: attribute set of (submodule)
Declared in: clanServices/localbackup/default.nix
the directory to backup
Type: string
Declared in: clanServices/localbackup/default.nix
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 Declared in: clanServices/localbackup/default.nix
the name of the backup job
Type: string matching the pattern ^[a-zA-Z0-9._-]+$
Default:
"βΉnameβΊ" Declared in: clanServices/localbackup/default.nix
Shell commands to run after the backup
Type: null or strings concatenated with "\n"
Default:
null Declared in: clanServices/localbackup/default.nix
Shell commands to run after the directory is mounted
Type: null or strings concatenated with "\n"
Default:
null Declared in: clanServices/localbackup/default.nix
Shell commands to run after the directory is unmounted
Type: null or strings concatenated with "\n"
Default:
null Declared in: clanServices/localbackup/default.nix
Shell commands to run before the backup
Type: null or strings concatenated with "\n"
Default:
null Declared in: clanServices/localbackup/default.nix
Shell commands to run before the directory is mounted
Type: null or strings concatenated with "\n"
Default:
null Declared in: clanServices/localbackup/default.nix
Shell commands to run before the directory is unmounted
Type: null or strings concatenated with "\n"
Default:
null Declared in: clanServices/localbackup/default.nix