gpt4 book ai didi

linux - 列出最近的 ZFS 快照

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:15:54 28 4
gpt4 key购买 nike

我定期为 30 个虚拟机 (VM) 拍摄 ZFS 快照,进行 20 次版本控制。

我的快照列表仅适用于两个虚拟机:

rpool/data/vm-100-disk-1@rep_100_2018-08-14_20:08:20   218M      -  80.6G  -
rpool/data/vm-100-disk-1@rep_100_2018-08-15_00:13:27 46.4M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-15_04:23:47 20.6M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-15_08:11:11 53.3M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-15_11:12:03 181M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-15_14:12:32 176M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-15_17:12:09 126M - 80.5G -
rpool/data/vm-100-disk-1@rep_100_2018-08-15_20:11:06 120M - 80.5G -
rpool/data/vm-100-disk-1@rep_100_2018-08-16_05:29:05 157M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-16_11:27:24 6.72M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-16_11:28:08 6.75M - 80.6G -
rpool/data/vm-100-disk-1@rep_100_2018-08-16_14:07:33 208M - 80.5G -
rpool/data/vm-100-disk-1@rep_100_2018-08-16_17:08:18 142M - 80.4G -
rpool/data/vm-100-disk-1@rep_100_2018-08-16_20:05:09 55.3M - 80.4G -
rpool/data/vm-100-disk-1@rep_100_2018-08-17_00:08:29 53.7M - 80.4G -
rpool/data/vm-100-disk-1@rep_100_2018-08-17_04:07:15 46.3M - 80.4G -
rpool/data/vm-100-disk-1@rep_100_2018-08-17_08:06:04 53.9M - 80.4G -
rpool/data/vm-100-disk-1@rep_100_2018-08-17_11:05:05 209M - 80.3G -
rpool/data/vm-100-disk-1@rep_100_2018-08-17_14:15:43 202M - 80.3G -
rpool/data/vm-100-disk-1@rep_100_2018-08-17_17:20:43 0B - 80.2G -
rpool/data/vm-102-disk-1@rep_102_2018-08-14_20:06:09 588M - 75.5G -
rpool/data/vm-102-disk-1@rep_102_2018-08-15_00:06:33 106M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-15_04:11:10 65.2M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-15_08:06:22 60.6M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-15_11:07:57 56.8M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-15_14:08:06 58.4M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-15_17:08:28 61.0M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-15_20:07:40 68.4M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-16_05:22:16 68.4M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-16_11:19:01 1.46M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-16_11:19:21 1.39M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-16_14:04:35 44.4M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-16_17:03:48 43.5M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-16_20:02:45 52.8M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-17_00:03:51 63.9M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-17_04:04:03 61.9M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-17_08:03:45 48.1M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-17_11:02:28 51.9M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-17_14:11:25 72.1M - 75.6G -
rpool/data/vm-102-disk-1@rep_102_2018-08-17_17:16:03 0B - 75.6G -

如何只列出所有 VM 的最新拍摄快照以检查拍摄的最新快照?

最佳答案

最新拍摄的快照可以用这个获得:

zfs list -t snapshot -o name,creation -s creation | tail -n1

如果使用大写 -S 按属性降序排序,返回,在这种情况下,第一个拍摄的快照:

zfs list -t snapshot -o name,creation -S creation | tail -n1

关于linux - 列出最近的 ZFS 快照,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51899562/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com