Skip to content

Commit f8d2002

Browse files
committed
small fixes
1 parent 35bc1dc commit f8d2002

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

containers/backup.nix

+18
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@
2222
enable = true;
2323
};
2424

25+
environment.etc = {
26+
"prune.sh" = {
27+
enable = true;
28+
text = ''
29+
borg prune -v --list /var/bak/websites --keep-within=7d
30+
borg prune -v --list /var/bak/log --keep-within=7d
31+
'';
32+
};
33+
};
34+
35+
services.cron = {
36+
enable = true;
37+
# Run the prune script everyday at 2 AM
38+
systemCronJobs = [
39+
"0 2 * * * /etc/prune.sh"
40+
];
41+
};
42+
2543
services.borgbackup = {
2644
repos."/var/bak/" = {
2745
path = "/var/bak/";

containers/log.nix

+2-7
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,8 @@
4141
settings."multiple paths" = {
4242
compress = true;
4343
files = [
44-
"/var/log/websites/nginx.log"
45-
"/var/log/websites/mail"
46-
"/var/log/websites/messages"
47-
48-
"/var/log/dhcp/kea.log"
49-
"/var/log/dhcp/nginx.log"
50-
"/var/log/dhcp/messages"
44+
"/var/log/websites/*"
45+
"/var/log/dhcp/*"
5146
];
5247

5348
postrotate = ''

0 commit comments

Comments
 (0)