Skip to content

Commit 95cdd40

Browse files
committed
feat: adjust btrbk's backups preserve policy, and disable backups...
1 parent a04d6df commit 95cdd40

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

modules/nixos/base/btrbk.nix

+13-3
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,28 @@
2020
# How often this btrbk instance is started. See systemd.time(7) for more information about the format.
2121
onCalendar = "Tue,Fri,Sat,Sun *-*-* 3:45:20"; # daily at 3:45, except on Monday, Wednesday, and Thursday
2222
settings = {
23-
# keep daily snapshots for 14 days
23+
# how to prune local snapshots:
24+
# 1. keep daily snapshots for xx days
2425
snapshot_preserve = "9d";
25-
# keep all snapshots for 2 days, no matter how frequently you (or your cron job) run btrbk
26+
# 2. keep all snapshots for 2 days, no matter how frequently you (or your cron job) run btrbk
2627
snapshot_preserve_min = "2d";
28+
29+
# hot to prune remote incremental baqckups:
30+
# keep daily backups for 9 days, weekly backups for 4 weeks, and monthly backups for 2 months
31+
target_preserve = "9d 4w 2m";
32+
target_preserve_min = "no";
33+
2734
volume = {
2835
"/btr_pool" = {
2936
subvolume = {
3037
"@persistent" = {
3138
snapshot_create = "always";
3239
};
3340
};
34-
target = "/snapshots";
41+
42+
# backup to a remote server or a local directory
43+
# its prune policy is defined by `target_preserve` and `target_preserve_min`
44+
# target = "/snapshots";
3545
};
3646
};
3747
};

0 commit comments

Comments
 (0)