File: btrbk.conf.example

package info (click to toggle)
btrbk 0.31.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 592 kB
  • sloc: perl: 6,191; sh: 692; python: 201; makefile: 138
file content (182 lines) | stat: -rw-r--r-- 6,022 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#
# Example btrbk configuration file
#
#
# Please refer to the btrbk.conf(5) man-page for a complete
# description of all configuration options.
# For more examples, see README.md included with this package.
#
#   btrbk.conf(5): <https://digint.ch/btrbk/doc/btrbk.conf.5.html>
#   README.md:     <https://digint.ch/btrbk/doc/readme.html>
#
# Note that the options can be overridden per volume/subvolume/target
# in the corresponding sections.
#


# Enable transaction log
transaction_log            /var/log/btrbk.log

# Use long timestamp format (includes hour/minute)
timestamp_format           long

# Enable stream buffer. Adding a buffer between the sending and
# receiving side is generally a good idea.
# NOTE: If enabled, make sure to install the "mbuffer" package!
stream_buffer              256m

# Directory in which the btrfs snapshots are created. Relative to
# <volume-directory> of the volume section.
# If not set, the snapshots are created in <volume-directory>.
#
# If you want to set a custom name for the snapshot (and backups),
# use the "snapshot_name" option within the subvolume section.
#
# NOTE: btrbk does not autmatically create this directory, and the
# snapshot creation will fail if it is not present.
#
snapshot_dir               _btrbk_snap

# Always create snapshots. Set this to "ondemand" to only create
# snapshots if the target volume is reachable. Set this to "no" if
# snapshot creation is done by another instance of btrbk.
#snapshot_create            always

# Perform incremental backups (set to "strict" if you want to prevent
# creation of non-incremental backups if no parent is found).
#incremental                yes

# Specify after what time (in full hours after midnight) backups/
# snapshots are considered as a daily backup/snapshot
#preserve_hour_of_day       0

# Specify on which day of week weekly/monthly backups are to be
# preserved.
#preserve_day_of_week       sunday

# Preserve all snapshots for a minimum period of time.
#snapshot_preserve_min      1d

# Retention policy for the source snapshots.
#snapshot_preserve          <NN>h <NN>d <NN>w <NN>m <NN>y

# Preserve all backup targets for a minimum period of time.
#target_preserve_min        no

# Retention policy for backup targets:
#target_preserve            <NN>h <NN>d <NN>w <NN>m <NN>y

# Retention policy for archives ("btrbk archive" command):
#archive_preserve_min       no
#archive_preserve           <NN>h <NN>d <NN>w <NN>m <NN>y

# Specify SSH private key for "ssh://" volumes / targets:
#ssh_identity               /etc/btrbk/ssh/id_ed25519
#ssh_user                   root
#ssh_compression            no
#ssh_cipher_spec            default

# Enable compression for remote btrfs send/receive operations:
#stream_compress            no
#stream_compress_level      default
#stream_compress_threads    default

# Enable lock file support: Ensures that only one instance of btrbk
# can be run at a time.
#lockfile                   /var/lock/btrbk.lock

# Don't wait for transaction commit on deletion. Set this to "after"
# or "each" to make sure the deletion of subvolumes is committed to
# disk when btrbk terminates.
#btrfs_commit_delete        no


#
# Volume section: "volume <volume-directory>"
#
#   <volume-directory>  Directory of a btrfs volume (or subvolume)
#                       containing the subvolume to be backuped
#                       (usually the mount-point of a btrfs filesystem
#                       mounted with subvolid=5 option)
#
# Subvolume section: "subvolume <subvolume-name>"
#
#   <subvolume-name>    Subvolume to be backuped, relative to
#                       <volume-directory> in volume section.
#
# Target section: "target <type> <volume-directory>"
#
#   <type>              (optional) type, defaults to "send-receive".
#   <volume-directory>  Directory of a btrfs volume (or subvolume)
#                       receiving the backups.
#
# NOTE: The parser does not care about indentation, this is only for
# human readability. The options always apply to the last section
# encountered, overriding the corresponding option of the upper
# section. This means that the global options must be set before any
# "volume" section.
#


#
# Example configuration:
#
snapshot_preserve_min   2d
snapshot_preserve       14d

target_preserve_min     no
target_preserve         20d 10w *m

archive_preserve_min    latest
archive_preserve        12m 10y

# Backup to external disk mounted on /mnt/btr_backup
#
# Note that you cannot backup the subvolume "/" (root) directly. In
# oreder to backup "/" the top-level subvolume (subvolid=5) needs to
# be mounted first:
#  $ mount -o subvolid=5 /dev/sda1 /mnt/btr_pool
#
volume /mnt/btr_pool
  # No action if external disk is not attached
  snapshot_create ondemand

  # Target for all subvolume sections:
  target /mnt/btr_backup/_btrbk

  # Some default btrfs installations (e.g. Ubuntu) use "@" for rootfs
  # (mounted at "/") and "@home" (mounted at "/home"). Note that this
  # is only a naming convention.
  #subvolume @
  subvolume root
  subvolume home
  subvolume kvm
    # Use different retention policy for kvm backups:
    target_preserve 7d 4w


# Backup data to external disk as well as remote host
volume /mnt/btr_data
  subvolume  data
    # Always create snapshot, even if targets are unreachable
    snapshot_create always
    target /mnt/btr_backup/_btrbk
    target ssh://backup.my-remote-host.com/mnt/btr_backup


# Backup from remote host, with different naming
volume ssh://my-remote-host.com/mnt/btr_pool
  subvolume data_0
    snapshot_dir   snapshots/btrbk
    snapshot_name  data_main
    target /mnt/btr_backup/_btrbk/my-remote-host.com


# Resume backups from remote host which runs its own btrbk instance
# creating snapshots for "home" in "/mnt/btr_pool/btrbk_snapshots".
volume ssh://my-remote-host.com/mnt/btr_pool
  snapshot_dir           btrbk_snapshots
  snapshot_create        no
  snapshot_preserve_min  all
  subvolume home
    target /mnt/btr_backup/_btrbk/my-remote-host.com