Added a backup script and timer
This commit is contained in:
parent
c9f6fb77d0
commit
8d7edc72ee
2 changed files with 23 additions and 0 deletions
|
|
@ -29,6 +29,24 @@
|
|||
services.resolved.enable = true;
|
||||
services.resolved.extraConfig = "DNSStubListener=no\n";
|
||||
|
||||
systemd.timers."backupSyncthing" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."backupSyncthing" = {
|
||||
script = ''
|
||||
/home/horseman/nix-config/misc/backup.sh
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
};
|
||||
};
|
||||
|
||||
services.samba = {
|
||||
enable = false;
|
||||
securityType = "user";
|
||||
|
|
|
|||
5
misc/backup.sh
Normal file
5
misc/backup.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd /home/horseman
|
||||
|
||||
tar -cf backups/$(date +%Y-%m-%d).tar Documents
|
||||
Loading…
Add table
Add a link
Reference in a new issue