automorphism88 / snapraid-btrfs

Script for using snapraid with btrfs snapshots
GNU General Public License v3.0
138 stars 16 forks source link

Support snapper 0.11.0 #34

Open D34DC3N73R opened 7 months ago

D34DC3N73R commented 7 months ago

Snapper 0.11.0 uses (light vertical box drawing character) instead of | (pipe) so sed SUBVOLUME string matching fails, which in turn gives the error message "snapraid-btrfs: No snapper configs found for any data drives in /etc/snapraid.conf". This PR adds the vertical box drawing character to the sed command so either string is removed and snapper configs are matched appropriately. There is also a commit to update the copyright years.

using original code with snapper 0.11.0

$ snapper -c data1 get-config 2>/dev/null | sed -e '/^SUBVOLUME /!d' -e 's/^SUBVOLUME[ ]*| //'
SUBVOLUME              │ /mnt/data/1

using PR code with snapper 0.11.0

$ snapper -c data1 get-config 2>/dev/null | sed -e '/^SUBVOLUME /!d' -e 's/^SUBVOLUME[ ]*[|│] //'
/mnt/data/1
D34DC3N73R commented 2 weeks ago

This is also needed with snapper version 0.12.0