aplysia: add backup cronjob

This commit is contained in:
Gabriel Ebner 2019-12-01 12:29:57 +01:00
parent c21f3ee608
commit cfad7061f8

@ -204,4 +204,28 @@ in
${pkgs.hdparm}/bin/hdparm -B127 -S100 /dev/sd{a,b,c,d,e,f}
'';
systemd.services.backup-fotos = rec {
wants = [ "network.target" "mnt-aplysia.mount" ];
after = wants;
serviceConfig = {
User = "gebner";
Group = "users";
Type = "oneshot";
};
script = ''
${pkgs.rclone}/bin/rclone sync -v --update --use-server-modtime \
/mnt/aplysia/fotos/lightroom/ \
glacier:gebner-fotos-raw-backup/
'';
};
systemd.timers.backup-fotos = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "Mon,Fri 03:00";
Persistent = true;
};
};
}