cli: add 'node restore' command for undeleting nodes
Restores a deleted node to its last non-deleted content with proper version continuity (version number continues from absolute latest, content from last live version). Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
290505fc51
commit
6a5b840db3
3 changed files with 23 additions and 1 deletions
|
|
@ -32,6 +32,17 @@ pub async fn cmd_node_rename(old_key: &str, new_key: &str) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn cmd_node_restore(key: &[String]) -> Result<()> {
|
||||
if key.is_empty() {
|
||||
bail!("node-restore requires a key");
|
||||
}
|
||||
super::check_dry_run();
|
||||
let key = key.join(" ");
|
||||
let result = memory::memory_restore(None, &key).await?;
|
||||
println!("{}", result);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn cmd_render(key: &[String]) -> Result<()> {
|
||||
if key.is_empty() {
|
||||
bail!("render requires a key");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue