mirror of
https://github.com/edu4rdshl/rusnapshot.git
synced 2026-07-17 23:24:55 +00:00
Allow to restore snapshots in a user-defined directory.
This commit is contained in:
parent
dbd488240c
commit
28a754574c
2 changed files with 4 additions and 2 deletions
|
|
@ -19,7 +19,7 @@ args:
|
|||
multiple: false
|
||||
|
||||
- source-dir:
|
||||
help: Directory from where snapshots should be created.
|
||||
help: Directory from where snapshots should be created. It can also be used to specify the directory where a snapshot will be restored.
|
||||
long: from
|
||||
takes_value: true
|
||||
multiple: false
|
||||
|
|
|
|||
|
|
@ -45,7 +45,9 @@ pub fn manage_restoring(args: &mut Args) -> Result<()> {
|
|||
let snapshot_data = database::return_snapshot_data(&connection, args)?;
|
||||
if !snapshot_data.snap_id.is_empty() {
|
||||
args.snapshot_name = snapshot_data.destination + &snapshot_data.name;
|
||||
args.source_dir = snapshot_data.source;
|
||||
if args.source_dir.is_empty() {
|
||||
args.source_dir = snapshot_data.source;
|
||||
}
|
||||
} else {
|
||||
eprintln!(
|
||||
"Snapshot ID {} does not returned any data. Please double check the ID.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue