small cleanup
This commit is contained in:
+12
@@ -21,12 +21,24 @@ fn main() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Export the ZFS pool after the backup so it can be re-encrypted.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// This function will return an error if the name of the backup pool is not provided or the pool
|
||||
/// cannot be exported.
|
||||
fn export_backup_pool() -> Result<()> {
|
||||
let pool_name = &read_var_from_file("backup_pool.txt")?;
|
||||
zpool_export(pool_name)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Import the decrypted ZFS pool so that a backup can be sent.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// This function will return an error if the name of the backup pool is not provided or the pool
|
||||
/// cannot be imported.
|
||||
fn import_backup_pool() -> Result<()> {
|
||||
let pool_name = &read_var_from_file("backup_pool.txt")?;
|
||||
zpool_import(pool_name)?;
|
||||
|
||||
+2
-4
@@ -7,12 +7,10 @@ use std::{
|
||||
|
||||
use anyhow::{Result, anyhow, bail};
|
||||
|
||||
use crate::cmd::zfs::{
|
||||
pool_exists, zfs_list_main_datasets, zfs_list_snapshots, zfs_receive, zfs_send_absolute,
|
||||
zfs_send_incremental, zpool_import,
|
||||
};
|
||||
use crate::cmd::zfs::*;
|
||||
use crate::io::read_vars_from_file;
|
||||
|
||||
/// A ZFS pool. It holds the name of the pool and the list of datasets belonging to it.
|
||||
pub struct Pool {
|
||||
name: String,
|
||||
pub datasets: Vec<Dataset>,
|
||||
|
||||
Reference in New Issue
Block a user