nix-dotfiles/machines/galadriel/backup.nix.bak

32 lines
626 B
Nix
Raw Normal View History

2024-03-22 12:55:22 +01:00
{ pkgs, ... }:
{
systemd.user.services = {
dataBackup = {
path = [
pkgs.rsync
];
Unit = {
Description = "/Data backup to /Main";
After = [ "network.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "rsync --archive /Data/ /Main/Data";
};
Install.WantedBy = [ "default.target" ];
};
};
systemd.user.timers = {
dataBackup = {
Unit.Description = "/Data backup schedule";
Timer = {
Unit = "dataBackup";
OnCalendar = "06:00";
};
Install.WantedBy = [ "timers.target" ];
};
};
}