Bugs solved
This commit is contained in:
parent
080dd58916
commit
81102c8a27
|
@ -1,4 +1,4 @@
|
||||||
vn-vmware (1.0.7) stable; urgency=low
|
vn-vmware (1.0.8) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ use File::Path;
|
||||||
use Net::OpenSSH;
|
use Net::OpenSSH;
|
||||||
use Sys::CPU;
|
use Sys::CPU;
|
||||||
use Term::ANSIColor;
|
use Term::ANSIColor;
|
||||||
|
use List::Util qw(min max);
|
||||||
|
|
||||||
use constant false => 0;
|
use constant false => 0;
|
||||||
use constant true => 1;
|
use constant true => 1;
|
||||||
|
@ -439,7 +440,7 @@ sub backup_machine() {
|
||||||
log_message "Consolidating and removing snapshots.";
|
log_message "Consolidating and removing snapshots.";
|
||||||
$vm->RemoveAllSnapshots();
|
$vm->RemoveAllSnapshots();
|
||||||
|
|
||||||
my $gzip_cpus = int(Sys::CPU::cpu_count()) - 1;
|
my $gzip_cpus = max(1, int(Sys::CPU::cpu_count()) - 1);
|
||||||
my $tar_command = "tar -I \"pigz -p $gzip_cpus\" -cf $tar_file -C $local_tmp_dir .";
|
my $tar_command = "tar -I \"pigz -p $gzip_cpus\" -cf $tar_file -C $local_tmp_dir .";
|
||||||
|
|
||||||
log_message "Compressing with Gzip (using $gzip_cpus CPUs) to TAR file: $tar_file";
|
log_message "Compressing with Gzip (using $gzip_cpus CPUs) to TAR file: $tar_file";
|
||||||
|
@ -472,8 +473,6 @@ sub backup_machine() {
|
||||||
sub rotate_backup() {
|
sub rotate_backup() {
|
||||||
log_message "Rotating '$vm_name' backups.";
|
log_message "Rotating '$vm_name' backups.";
|
||||||
|
|
||||||
use List::Util qw[min];
|
|
||||||
|
|
||||||
my $local_dir = "$local_backup_dir/$vm_name";
|
my $local_dir = "$local_backup_dir/$vm_name";
|
||||||
|
|
||||||
if ($rotation_days == 0 && $rotation_count == 0) {
|
if ($rotation_days == 0 && $rotation_count == 0) {
|
||||||
|
|
Reference in New Issue