lvm-restic-backup
lvm-restic-backup copied to clipboard
LVM restic & rescript backup
This bash script backups logical volumes via restic. To simplify repo handling, this script takes repo details from rescript config.
Requirements
Additional requirements for Restore
Optional Req. for Zabbix Monitoring
- zabbix-sender
- pip3
- python3: humanfriendly
- Zabbix Rescript Restic Backup Template
How to use
lvm-rescript [repo_name] [command] [lv_name|path-to-list]
Commands
block-level-backupcreates a lvm-snapshot & pipes the volume using dd to resticblock-level-gz-backupcreates a lvm-snapshot & pipes the volume using dd and pigz to resticfile-level-backupcreates a lvm-snapshot & creates a restic backup using the mounted snapshotblock-level-restorerestores dd stored logical volume(s)block-level-gz-restorerestores dd and pigz stored logical volume(s)file-level-restorerestores as ext4 disk using a volume mount
Logical Volume
- Provide the LV name without VG.
- Provide the path to a list of LV names. LVs listed as #comment won't be backed up.
- Omit, to backup all volumes, except *bak, *cache, *swap, *swp and *tmp.
How to install
curl -o /usr/bin/lvm-rescript https://raw.githubusercontent.com/sebastian13/lvm-restic-backup/master/lvm-restic-backup.sh
chmod +x /usr/bin/lvm-rescript
For Zabbix LVM Discovery also download the script:
curl -o /etc/zabbix/scripts/rescript-lvm-discovery.pl https://raw.githubusercontent.com/sebastian13/zabbix-templates/master/rescript-restic-backup/scripts/rescript-lvm-discovery.pl
chmod +x /etc/zabbix/scripts/rescript-lvm-discovery.pl