Skip to content

Commit 1ed9138

Browse files
authored
Introduce ZFS Snapshots (#718)
1 parent ae79af5 commit 1ed9138

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

nextcloud_update.sh

+10
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,16 @@ then
266266
mkdir -p $BACKUP
267267
fi
268268

269+
# Do a backup of the ZFS mount
270+
if dpkg -l | grep libzfs2linux
271+
then
272+
if grep -r ncdata /etc/mtab
273+
then
274+
install_if_not zfs-auto-snapshot
275+
check_command zfs-auto-snapshot -r ncdata
276+
fi
277+
fi
278+
269279
# Backup data
270280
for folders in config themes apps
271281
do

static/format-sdb.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ msg_box "/dev/$DEVTYPE is mounted and need to be unmounted before you can run th
9494
exit 1
9595
fi
9696

97-
#Universal:
97+
# Universal:
9898
if isMounted "/mnt/ncdata";
9999
then
100100
msg_box "/mnt/ncdata is mounted and need to be unmounted before you can run this script."
@@ -148,6 +148,15 @@ fi
148148
}
149149
format
150150

151+
# Do a backup of the ZFS mount
152+
if dpkg -l | grep libzfs2linux
153+
then
154+
if grep -r $LABEL_ /etc/mtab
155+
then
156+
install_if_not zfs-auto-snapshot
157+
fi
158+
fi
159+
151160
# Success!
152161
if grep "$LABEL_" /etc/mtab
153162
then
@@ -156,9 +165,13 @@ msg_box "$MOUNT_ mounted successfully as a ZFS volume.
156165
Automatic scrubbing is done monthly via a cronjob that you can find here:
157166
/etc/cron.d/zfsutils-linux
158167
168+
Automatic snapshots are taken with 'zfs-auto-snapshot'. You can list current snapshots with:
169+
'sudo zfs list -t snapshot'.
170+
Manpage is here:
171+
http://manpages.ubuntu.com/manpages/bionic/man8/zfs-auto-snapshot.8.html
172+
159173
CURRENT STATUS:
160174
$(zpool status $LABEL_)
161175
162176
$(zpool list)"
163177
fi
164-

0 commit comments

Comments
 (0)