diff --git a/virt-backup b/virt-backup index 0f9eca2..ac0e7da 100644 --- a/virt-backup +++ b/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{