CLI を使用した手動スナップショット
シェアのスナップショットにアクセスするには、シェアおよびスナップショットのコンテキストに移動します。
clownfish:> shares select default select builds
clownfish:shares default/builds> snapshots
clownfish:shares default/builds snapshots>
スナップショットの一覧表示 (CLI)
スナップショットは、標準の CLI コマンドを使用して一覧表示できます。
clownfish:shares default/builds snapshots> list
today
yesterday
clownfish:shares default/builds snapshots>
手動スナップショットの作成 (CLI)
手動プロジェクトレベルのスナップショットを作成するには、プロジェクトおよびスナップショットノードに移動して、snapshot コマンドを使用します。
clownfish:cd /
clownfish:shares select myproject snapshots
clownfish:shares myproject snapshots> snapshot cob_monday
個別のシェアの手動シェアレベルスナップショットを作成するには、そのシェアに移動し、そこで snapshot コマンドを使用します。
clownfish:cd /
clownfish:shares select myproject select share1 snapshots
clownfish:snapshot lunchtime
スナップショットの名前の変更 (CLI)
スナップショットの名前を変更するには、rename コマンドを使用します。
clownfish:shares default/builds snapshots> rename test test2
clownfish:shares default/builds snapshots>
スナップショットの破棄 (CLI)
スナップショットを破棄するには、destroy コマンドを使用します。
clownfish:shares default/builds snapshots> select test2
clownfish:shares default/builds@test2> destroy
This will destroy this snapshot. Are you sure? (Y/N)
clownfish:shares default/builds snapshots>
個別のスナップショットを選択せずに、シェアコンテキストから destroy コマンドを使用することもできます。
clownfish:shares default/builds snapshots> destroy test2
This will destroy this snapshot. Are you sure? (Y/N)
clownfish:shares default/builds snapshots>
スナップショットへのロールバック (CLI)
スナップショットにロールバックするには、目的のスナップショットを選択し、rollback コマンドを実行します。
clownfish:shares default/builds snapshots> select today
clownfish:shares default/builds@today> rollback
Rolling back will revert data to snapshot, destroying newer data. Active
initiators will be disconnected.
Continue? (Y/N)
clownfish:shares default/builds@today>
スナップショットのクローニング (CLI)
スナップショットのクローンを作成するには、clone コマンドを使用します。このコマンドを実行すると、シェアの作成に使用されたものと同じ未確定のシェアコンテキストに移動します。ここで、必要に応じてプロパティーを調整してから、変更を確定してクローンを作成できます。
clownfish:shares default/builds snapshots> select today
clownfish:shares default/builds@today> clone testbed
clownfish:shares default/testbed (uncommitted clone)> get
aclinherit = restricted (inherited)
aclmode = discard (inherited)
atime = true (inherited)
checksum = fletcher4 (inherited)
compression = off (inherited)
copies = 1 (inherited)
mountpoint = /export/testbed (inherited)
quota = 0 (default)
readonly = false (inherited)
recordsize = 128K (inherited)
reservation = 0 (default)
secondarycache = all (inherited)
nbmand = false (inherited)
sharesmb = off (inherited)
sharenfs = on (inherited)
snapdir = hidden (inherited)
vscan = false (inherited)
sharedav = off (inherited)
shareftp = off (inherited)
root_group = other (default)
root_permissions = 777 (default)
root_user = nobody (default)
quota_snap = true (default)
reservation_snap = true (default)
clownfish:shares default/testbed (uncommitted clone)> set quota=10G
quota = 10G (uncommitted)
clownfish:shares default/testbed (uncommitted clone)> commit
clownfish:shares default/builds@today>
このコマンドには、クローンを作成するプロジェクトをオプションの第 1 引数として指定することもできます。デフォルトでは、クローンの作成元のシェアと同じプロジェクトにクローンが作成されます。
CLI を使用した依存クローンの一覧表示
特定のスナップショット (依存クローン) から作成されたすべてのクローンを一覧表示するには、そのスナップショットに移動し、list clones コマンドを使用します。
clonefish:shares default/builds> snapshots
clonefish:shares default/builds snapshots> select today
clonefish:shares default/builds@today> list clones
Clones: 2 total
PROJECT SHARE
default testbed
default production
clonefish:shares default/builds@today>
結果には、クローン名と、そのクローンが存在するプロジェクトが表示されます。
CLI を使用した定期スナップショット
自動定期スナップショットは、個別シェアのプロジェクトレベルで、スナップショットコンテキストから automatic コマンドを使用すると構成できます。このコンテキストに移動したあと、create コマンドと destroy コマンドを使用すると、間隔の追加と削除を行うことができます。各間隔には、BUI ビューでの頻度、オフセット、および保持するスナップショット数に対応する、一連のプロパティーがあります。スケジュールは UTC 形式で維持されます。
clownfish:shares default/builds snapshots> automatic
clownfish:shares default/builds snapshots automatic> create
clownfish:shares default/builds snapshots automatic (uncommitted)> set frequency=day
frequency = day (uncommitted)
clownfish:shares default/builds snapshots automatic (uncommitted)> set hour=14
hour = 14 (uncommitted)
clownfish:shares default/builds snapshots automatic (uncommitted)> set minute=30
minute = 30 (uncommitted)
clownfish:shares default/builds snapshots automatic (uncommitted)> set keep=7
keep = 7 (uncommitted)
clownfish:shares default/builds snapshots automatic (uncommitted)> get
frequency = day (uncommitted)
day = (unset)
hour = 14 (uncommitted)
minute = 30 (uncommitted)
keep = 7 (uncommitted)
clownfish:shares default/builds snapshots automatic (uncommitted)> commit
clownfish:shares default/builds snapshots automatic> list
NAME FREQUENCY DAY HH:MM KEEP
automatic-000 day - 14:30 7
clownfish:shares default/builds snapshots automatic> done
clownfish:shares default/builds snapshots>
CLI を使用した定期スナップショットラベルの設定
BUI では、プロジェクトまたはシェアに対して「定期スナップショットラベル」プロパティーを設定できます。同様に、CLI では、最初にプロジェクトまたはシェアコンテキストに移動することで、ラベルを設定できます。定期スナップショットラベルを作成するには、set snaplabel コマンドを使用します。
clownfish:shares project1/share1> set snaplabel=project1:share1