mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-15 22:41:52 +03:00
123
This commit is contained in:
@@ -62,7 +62,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
# Mobile SD-Card
|
# Mobile SD-Card
|
||||||
"/mnt/mobile-sd" = {
|
"/mnt/mobile" = {
|
||||||
device = "/dev/disk/by-uuid/7EB1-DC99";
|
device = "/dev/disk/by-uuid/7EB1-DC99";
|
||||||
fsType = "exfat";
|
fsType = "exfat";
|
||||||
options = [
|
options = [
|
||||||
|
|||||||
@@ -46,6 +46,11 @@
|
|||||||
default = "/mnt/archive";
|
default = "/mnt/archive";
|
||||||
description = "Archive drive mount point.";
|
description = "Archive drive mount point.";
|
||||||
};
|
};
|
||||||
|
mobile-drive = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "/mnt/mobile";
|
||||||
|
description = "Mobile drive mount point.";
|
||||||
|
};
|
||||||
therima-drive = lib.mkOption {
|
therima-drive = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "/mnt/therima";
|
default = "/mnt/therima";
|
||||||
|
|||||||
@@ -7,11 +7,10 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
systemd = {
|
systemd = {
|
||||||
services.rsync-archive = {
|
services = {
|
||||||
|
rsync-archivesta = {
|
||||||
# Archivesta
|
# Archivesta
|
||||||
# Make copy of files
|
|
||||||
description = "Backup data using rsync";
|
description = "Backup data using rsync";
|
||||||
#after = [ ];
|
|
||||||
requisite = [ "mnt-archive.mount" ]; # hard-code
|
requisite = [ "mnt-archive.mount" ]; # hard-code
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.rsync}/bin/rsync -rtv --delete ${xlib.dirs.services-folder}/ ${xlib.dirs.archive-drive}/Services/
|
${pkgs.rsync}/bin/rsync -rtv --delete ${xlib.dirs.services-folder}/ ${xlib.dirs.archive-drive}/Services/
|
||||||
@@ -24,8 +23,26 @@
|
|||||||
IOSchedulingClass = "idle";
|
IOSchedulingClass = "idle";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
timers.rsync-archive = {
|
rsync-archivesta-lite = {
|
||||||
description = "Run rsync backup weekly";
|
# Archivesta Lite
|
||||||
|
description = "Backup data using rsync";
|
||||||
|
requisite = [ "mnt-mobile.mount" ]; # hard-code
|
||||||
|
script = ''
|
||||||
|
${pkgs.rsync}/bin/rsync -rtv --delete ${xlib.dirs.services-folder}/ ${xlib.dirs.mobile-drive}/
|
||||||
|
${pkgs.rsync}/bin/rsync -rtv --delete ${xlib.dirs.services-folder}/ ${xlib.dirs.mobile-drive}/
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "root";
|
||||||
|
Group = "root";
|
||||||
|
Nice = 19;
|
||||||
|
IOSchedulingClass = "idle";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
timers = {
|
||||||
|
rsync-archivesta = {
|
||||||
|
description = "Run rsync backup daily";
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "daily";
|
OnCalendar = "daily";
|
||||||
@@ -33,5 +50,15 @@
|
|||||||
Unit = "rsync-archive.service";
|
Unit = "rsync-archive.service";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
rsync-archivesta-lite = {
|
||||||
|
description = "Run rsync backup weekly";
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "weekly";
|
||||||
|
Persistent = true;
|
||||||
|
Unit = "rsync-archive.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user