Skip to content

Instantly share code, notes, and snippets.

@cransom
Created February 4, 2019 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cransom/8efe056c6250387e42980a5ac539fe05 to your computer and use it in GitHub Desktop.
Save cransom/8efe056c6250387e42980a5ac539fe05 to your computer and use it in GitHub Desktop.
systemd.services.somemachine-rsync = {
after = [
"zfs-import-tank.service"
];
path = [ pkgs.rsync ];
#this notifies another unit in case it fails, i get a text to my phone.
onFailure = [
"unit-status@%n"
];
script = ''
rsync -Hax --delete somemachine.example.com::root/ /tank/backup/somemachine/
'';
};
systemd.timers.somemachine-rsync = {
timerConfig.OnCalendar = "*-*-* 3:00:00";
wantedBy = [ "timers.target" ];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment