mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-30 05:02:54 +08:00
bring file-backed rpool mirror over sshfs/samba up/down
This commit is contained in:
parent
ecde665923
commit
c37ac6aeac
21
proxmox/zpo.sh
Normal file
21
proxmox/zpo.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Bring a zfs file-backed mirror file online/offline to refresh/resilver the backup
|
||||
# 2024.Jun kneutron
|
||||
|
||||
logf=~/rpool-online-offline-mirdisk.log
|
||||
|
||||
# change online/offline state of sshfs mirror disk for STABILITY and resilver updating
|
||||
mirdisk=$(zpool status -v |grep rpool-mirror-.*zfs-efi.disk |awk '{print $1}')
|
||||
|
||||
if [ "$1" = "1" ]; then
|
||||
# TODO add if-mounted test here
|
||||
echo "$(date) - Onlining rpool $mirdisk" |tee -a $logf
|
||||
(set -x; time zpool online rpool $mirdisk)
|
||||
zfs-watchresilver-boojum.sh
|
||||
else
|
||||
echo "$(date) - Offlining rpool $mirdisk" |tee -a $logf
|
||||
(set -x; time zpool offline rpool $mirdisk)
|
||||
fi
|
||||
|
||||
zpool status rpool -v |awk 'NF>0'
|
Loading…
x
Reference in New Issue
Block a user