add archives group
This commit is contained in:
@@ -9,7 +9,7 @@ in a borg archive to the specified repo
|
||||
|
||||
| <3yy> |
|
||||
V V
|
||||
modules.system.backups.baks = {
|
||||
system.backups.baks = {
|
||||
${service} = { paths = [ cfg.data_dir ]; };
|
||||
};
|
||||
*/
|
||||
@@ -46,12 +46,17 @@ in
|
||||
|
||||
config = lib.mkIf (cfg.enable && cfg.baks != {}) {
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /holocron/archives 2770 root archives - -"
|
||||
];
|
||||
|
||||
systemd.services.backups = {
|
||||
description = "backup service with borg!";
|
||||
path = [ pkgs.borgbackup ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
# EnvironmentFile = config.modules.system.backups.passphraseFile;
|
||||
User = "root";
|
||||
Group = "archives"; # make perms shake out
|
||||
# the actual script borg is using
|
||||
ExecStart = pkgs.writeShellScript "borg-backup" ''
|
||||
backup() {
|
||||
@@ -59,7 +64,7 @@ in
|
||||
export BORG_PASSPHRASE="$(cat ${cfg.passwd_file})"
|
||||
export BORG_REPO="${cfg.repo}"
|
||||
timestamp="$(date +'%Y-%m-%d_%H:%M:%S')"
|
||||
mode=${cfg.mode}
|
||||
mode=split
|
||||
|
||||
# init repo in needed
|
||||
if ! borg info "$BORG_REPO" >/dev/null 2>&1; then
|
||||
@@ -80,7 +85,7 @@ in
|
||||
echo "backing up: ${lib.concatStringsSep " " bak_paths.paths} → $archive"
|
||||
borg create \
|
||||
--verbose \
|
||||
# --filter AME \
|
||||
--filter AME \
|
||||
--list \
|
||||
--stats \
|
||||
--show-rc \
|
||||
|
||||
Reference in New Issue
Block a user