Restructure files into roles
This commit is contained in:
253
roles/dotfiles/workstation/home/.config/btrbk/btrbk.conf
Normal file
253
roles/dotfiles/workstation/home/.config/btrbk/btrbk.conf
Normal file
@@ -0,0 +1,253 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
# Specify SSH private key for remote connections
|
||||
ssh_identity /home/bryan/.config/btrbk/id_ed25519
|
||||
ssh_user root
|
||||
|
||||
# Use sudo if btrbk or lsbtr is run by regular user
|
||||
backend_local_user btrfs-progs-sudo
|
||||
|
||||
# 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 1g
|
||||
|
||||
# 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 automatically create this directory, and the
|
||||
# snapshot creation will fail if it is not present.
|
||||
#
|
||||
snapshot_dir .snapshots
|
||||
|
||||
# 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 onchange
|
||||
|
||||
# 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
|
||||
|
||||
# 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. Enable this to make
|
||||
# sure the deletion of subvolumes is committed to disk when btrbk
|
||||
# terminates.
|
||||
#btrfs_commit_delete no
|
||||
|
||||
|
||||
#
|
||||
# Volume section (optional): "volume <volume-directory>"
|
||||
#
|
||||
# <volume-directory> Base path within a btrfs filesystem
|
||||
# containing the subvolumes 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 within a btrfs filesystem
|
||||
# receiving the backups.
|
||||
#
|
||||
# NOTE: The parser does not care about indentation, this is only for
|
||||
# human readability. All options apply to the last section
|
||||
# encountered, overriding the corresponding option of the upper
|
||||
# section. This means that the global options must be set on top,
|
||||
# before any "volume", "subvolume" or "target section.
|
||||
#
|
||||
|
||||
#
|
||||
# Example retention policy:
|
||||
#
|
||||
# snapshot_preserve_min 2d
|
||||
# snapshot_preserve 14d
|
||||
# target_preserve_min no
|
||||
# target_preserve 20d 10w *m
|
||||
|
||||
snapshot_preserve_min 2d
|
||||
snapshot_preserve 14d
|
||||
|
||||
target_preserve_min no
|
||||
target_preserve 14d 10w *m
|
||||
|
||||
archive_preserve_min latest
|
||||
archive_preserve 12m 10y
|
||||
|
||||
# Global settings
|
||||
compat_remote busybox
|
||||
send_protocol 2
|
||||
|
||||
# Root backup workaround, omit the volume section
|
||||
subvolume /
|
||||
target_preserve 14d 10w 6m
|
||||
snapshot_dir /.snapshots # Absolute path to snapshots dir
|
||||
target /mnt/backup/workstation/root
|
||||
# target ssh://router.lan/mnt/backup/workstation/root
|
||||
# target /run/media/bryan/backup/workstation/root
|
||||
# target ssh://home-router/mnt/backup/workstation/root
|
||||
|
||||
volume /home
|
||||
subvolume bryan
|
||||
target /mnt/backup/workstation/home
|
||||
# target ssh://router.lan/mnt/backup/workstation/home
|
||||
target_preserve 14d 10w 6m
|
||||
# target ssh://home-router/mnt/backup/workstation/home
|
||||
# target /run/media/bryan/backup/workstation/home
|
||||
|
||||
volume /mnt/downloads
|
||||
subvolume downloads
|
||||
target /mnt/backup/workstation/downloads
|
||||
# target /run/media/bryan/backup/workstation/downloads
|
||||
|
||||
volume /
|
||||
subvolume /mnt/ebooks
|
||||
target /mnt/backup/media
|
||||
subvolume /mnt/cover-art
|
||||
target /mnt/backup/media
|
||||
# target ssh://router.lan/mnt/backup/media
|
||||
# target ssh://home-router/mnt/backup/media
|
||||
|
||||
volume /mnt/array/media
|
||||
target /mnt/backup/media
|
||||
# target ssh://router.lan/mnt/backup/media
|
||||
# target ssh://home-router/mnt/backup/media
|
||||
subvolume pictures
|
||||
subvolume music
|
||||
target_preserve_min all # for home-router to keep samba share (and safer overall)
|
||||
|
||||
|
||||
# #
|
||||
# # Simple setup: Backup root and home to external disk
|
||||
# #
|
||||
# snapshot_dir /btrbk_snapshots
|
||||
# target /mnt/btr_backup
|
||||
# subvolume /
|
||||
# subvolume /home
|
||||
|
||||
|
||||
# #
|
||||
# # Complex setup
|
||||
# #
|
||||
# # In order to keep things organized, it is recommended to use "volume"
|
||||
# # sections and mount the top-level subvolume (subvolid=5):
|
||||
# #
|
||||
# # $ mount -o subvolid=5 /dev/sda1 /mnt/btr_pool
|
||||
# #
|
||||
# # Backup to external disk mounted on /mnt/btr_backup
|
||||
# volume /mnt/btr_pool
|
||||
# # Create snapshots in /mnt/btr_pool/btrbk_snapshots
|
||||
# snapshot_dir btrbk_snapshots
|
||||
|
||||
# # Target for all subvolume sections:
|
||||
# target /mnt/btr_backup
|
||||
|
||||
# # 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
|
||||
# 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/my-remote-host.com
|
||||
|
||||
|
||||
# # Backup on demand (noauto) to remote host running busybox, login as
|
||||
# # regular user using ssh-agent with current user name (ssh_user no)
|
||||
# # and default credentials (ssh_identity no).
|
||||
# volume /home
|
||||
# noauto yes
|
||||
# compat busybox
|
||||
# backend_remote btrfs-progs-sudo
|
||||
# ssh_user no
|
||||
# ssh_identity no
|
||||
|
||||
# target ssh://my-user-host.com/mnt/btr_backup/home
|
||||
# subvolume alice
|
||||
# subvolume bob
|
||||
|
||||
|
||||
# # 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/my-remote-host.com
|
||||
131
roles/dotfiles/workstation/root/etc/pwrstatd.conf
Normal file
131
roles/dotfiles/workstation/root/etc/pwrstatd.conf
Normal file
@@ -0,0 +1,131 @@
|
||||
#
|
||||
# pwrstatd configuration file
|
||||
#
|
||||
|
||||
# You must restart pwrstatd after changing this file in order for changes to take effect.
|
||||
# Ex:/etc/init.d/pwrstatd restart
|
||||
|
||||
#
|
||||
# Action setting for event of Power Failure
|
||||
#
|
||||
|
||||
# A delay time in seconds since event of Power Failure occur then to run shell
|
||||
# script and shutdown system. Allowed range is 0 ~ 3600. Default is 60 sec.
|
||||
powerfail-delay = 60
|
||||
|
||||
# Enable to run shell script when the event of Power Failure occur.
|
||||
# The allowed options are yes and no. Default is yes.
|
||||
powerfail-active = no
|
||||
|
||||
# Assign a path of script file for event of Power Failure.
|
||||
# The default is /etc/pwrstatd-powerfail.sh
|
||||
powerfail-cmd-path = /etc/pwrstatd-powerfail.sh
|
||||
|
||||
# How much time in seconds to take script running for event of Power Failure.
|
||||
# The allowed range is 0 ~ 3600. Default is 0 sec.
|
||||
powerfail-duration = 0
|
||||
|
||||
# Allow Daemon to shutdown system for event of Power Failure.
|
||||
# The allowed options are yes and no. Default is yes.
|
||||
powerfail-shutdown = no
|
||||
|
||||
#
|
||||
# Action setting for event of Battery Low
|
||||
#
|
||||
|
||||
# A threshold of Battery Capacity, If the battery capacity is lower than this
|
||||
# value and a event of Battery Low will be identified. The unit is percentage.
|
||||
# The allowed range is 0 ~ 90. Default is 35 %.
|
||||
lowbatt-threshold = 10
|
||||
|
||||
# A threshold of Remaining Runtime, If the Remaining Runtime is lower than this
|
||||
# value and a event of Battery Low will be identified. The unit is second.
|
||||
# The allowed range is 0 ~ 3600. Default is 300 sec.
|
||||
# Note: When meet this condition the below 'shutdown-sustain' property
|
||||
# will be ignored.
|
||||
runtime-threshold = 180
|
||||
|
||||
# Enable to run shell script when the event of Battery Low occur.
|
||||
# The allowed options are yes and no. Default is yes.
|
||||
lowbatt-active = no
|
||||
|
||||
# Assign a path of script file for event of Battery Low.
|
||||
# The default is /etc/pwrstatd-lowbatt.sh
|
||||
lowbatt-cmd-path = /etc/pwrstatd-lowbatt.sh
|
||||
|
||||
# How much time in seconds to take script running for event of Battery Low.
|
||||
# The allowed range is 0 ~ 60. Default is 0 sec.
|
||||
lowbatt-duration = 0
|
||||
|
||||
# Allow Daemon to shutdown system for event of Battery Low.
|
||||
# The allowed options are yes and no. Default is yes.
|
||||
lowbatt-shutdown = yes
|
||||
|
||||
# Turn UPS alarm on or off.
|
||||
# The allowed options are yes and no. Default is yes.
|
||||
enable-alarm = yes
|
||||
|
||||
# The necessary time in seconds for system shutdown.
|
||||
# The UPS will turn power off when this time is expired.
|
||||
# The allowed range is 0 ~ 3600. Default is 600 sec.(10 min.)
|
||||
# If the computer shutdown is cause by low runtime condition, the UPS will
|
||||
# turn power off when the time is expired that time is assigned on
|
||||
# 'runtime-threshold' property and it is no longer to refer the
|
||||
# 'shutdown-sustain' property.
|
||||
shutdown-sustain = 0
|
||||
|
||||
# Daemon will turn UPS power off once it ask system shutdown cause by a power
|
||||
# event. Allowed options are yes and no. Default is yes.
|
||||
turn-ups-off = no
|
||||
|
||||
# The period of polling UPS in seconds.
|
||||
# The allowed range is 1 ~ 60. Default is 3 sec.
|
||||
ups-polling-rate = 5
|
||||
|
||||
# the period of re-try to find available UPS in seconds since find nothing at
|
||||
# last time. The allowed range is 1 ~ 300. Default is 10 sec.
|
||||
ups-retry-rate = 10
|
||||
|
||||
# Prohibiting daemon to provide communication mechanism for client, such as
|
||||
# pwrstat command. normally, it should be 'no'. It can be 'yes' if any security
|
||||
# consideration. Allowed options are yes and no. Default is no.
|
||||
prohibit-client-access = no
|
||||
|
||||
# The pwrstatd accepts four types of device node which includes the 'ttyS',
|
||||
# 'ttyUSB', 'hiddev', and 'libusb' for communication with UPS. The pwrstatd
|
||||
# defaults to enumerate all acceptable device nodes and pick up to use an
|
||||
# available device node automatically. But this may cause a disturbance to the
|
||||
# device node which is occupied by other software. Therefore, you can restrict
|
||||
# this enumerate behave by using allowed-device-nodes option. You can assign
|
||||
# the single device node path or multiple device node paths divided by a
|
||||
# semicolon at this option. All groups of 'ttyS', 'ttyUSB', 'hiddev', or
|
||||
# 'libusb' device node are enumerated without a suffix number assignment.
|
||||
# Note, the 'libusb' does not support suffix number only.
|
||||
#
|
||||
# For example: restrict to use ttyS1, ttyS2 and hiddev1 device nodes at /dev
|
||||
# path only.
|
||||
# allowed-device-nodes = /dev/ttyS1;/dev/ttyS2;/dev/hiddev1
|
||||
#
|
||||
# For example: restrict to use ttyS and ttyUSB two groups of device node at
|
||||
# /dev,/dev/usb, and /dev/usb/hid paths(includes ttyS0 to ttySN and ttyUSB0 to
|
||||
# ttyUSBN, N is number).
|
||||
# allowed-device-nodes = ttyS;ttyUSB
|
||||
#
|
||||
# For example: restrict to use hiddev group of device node at /dev,/dev/usb,
|
||||
# and /dev/usb/hid paths(includes hiddev0 to hiddevN, N is number).
|
||||
# allowed-device-nodes = hiddev
|
||||
#
|
||||
# For example: restrict to use libusb device.
|
||||
# allowed-device-nodes = libusb
|
||||
allowed-device-nodes =
|
||||
|
||||
# Daemon will hibernate system to instead of system shutdown when power
|
||||
# event occur. Allowed options are yes and no. Default is no.
|
||||
hibernate = no
|
||||
|
||||
# Enable cloud solution.
|
||||
# The allowed options are yes and no. Default is no.
|
||||
cloud-active = no
|
||||
|
||||
# Account for cloud server login.
|
||||
cloud-account =
|
||||
Reference in New Issue
Block a user