Add a --no-offline flag to fail if livebackup isn't possible

tags/virt-backup-0.2.12-1
Daniel Berteaud 10 years ago
parent f25638e467
commit e86cff1db1
  1. 8
      virt-backup

@ -56,6 +56,8 @@ $opts{debug} = 0;
$opts{keeplock} = 0;
# Should we try to create LVM snapshots during the dump ?
$opts{snapshot} = 1;
# Should we pause the VM during the backup if we cannot take a snapshot ?
$opts{offline} = 1;
# Libvirt URI to connect to
@connect = ();
# Compression used with the dump action (the compression is done on the fly)
@ -107,6 +109,7 @@ GetOptions(
"unlock" => \$opts{unlock},
"connect=s" => \@connect,
"snapshot!" => \$opts{snapshot},
"offline!" => \$opts{offline},
"compress:s" => \$opts{compress},
"exclude=s" => \@excludes,
"blocksize=s" => \$opts{blocksize},
@ -457,6 +460,11 @@ sub prepare_backup{
}
}
}
# Are offline backups allowed ?
elsif (!$opts{offline}){
run_cleanup();
die "\nOffline backups disabled, sorry, I cannot continue\n";
}
}
sub run_dump{

Loading…
Cancel
Save