Created
June 28, 2019 18:24
-
-
Save chungy/f63384c76cca1a43fed17ec531c1299c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ExclusionList] | |
/lost+found | |
/*/.cache | |
/*/.local/share/Trash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
zfs set readonly=off usb/backup | |
CUR_DATE=$(date +%Y%m%d) | |
umask 77 | |
lvcreate -p r -s ace/root -l 936 -n root_snap | |
lvcreate -p r -s ace/home -l 936 -n home_snap | |
mount -r /dev/ace/root_snap /mnt | |
wimappend --quiet --unix-data --update-of=-2 --config=backup.conf /mnt system.wim root_${CUR_DATE} | |
umount /mnt | |
mount -r /dev/ace/home_snap /mnt | |
wimappend --quiet --unix-data --update-of=-2 --config=backup.conf /mnt system.wim home_${CUR_DATE} | |
umount /mnt | |
lvremove -y ace/root_snap | |
lvremove -y ace/home_snap | |
zfs set readonly=on usb/backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment