mkdir $syncdir;
my $cmd = $rsync_command->(
- $host_name, '--timeout', '10', "${host_ip}:$spooldir", $spooldir,
+ $host_name, '--timeout', '10', "[${host_ip}]:$spooldir", $spooldir,
'--files-from', $flistname);
PVE::Tools::run_command($cmd);
mkdir $syncdir;
my $cmd = $rsync_command->(
- $host_name, '-aq', '--timeout', '10', "${host_ip}:$syncdir/", $syncdir);
+ $host_name, '-aq', '--timeout', '10', "[${host_ip}]:$syncdir/", $syncdir);
foreach my $incl (('spam/', 'spam/*', 'spam/*/*', 'virus/', 'virus/*', 'virus/*/*')) {
push @$cmd, '--include', $incl;
mkdir $syncdir;
my $cmd = $rsync_command->(
- $host_name, '-aq', '--timeout', '10', "${host_ip}:$syncdir", $syncdir);
+ $host_name, '-aq', '--timeout', '10', "[${host_ip}]:$syncdir", $syncdir);
PVE::Tools::run_command($cmd);
}
my $cmd = $rsync_command->(
$master_name, '-aq',
- "${master_ip}:$cfgdir/* ${sa_conf_dir}/${sa_custom_cf}",
+ "[${master_ip}]:$cfgdir/* ${sa_conf_dir}/${sa_custom_cf}",
"$syncdir/",
'--exclude', 'master/',
'--exclude', '*~',
$mscount += $count;
- last if $mscount >= $maxmails;
-
- } while ($count >= $maxcount);
+ } while (($count >= $maxcount) && ($mscount < $maxmails));
PMG::DBTools::create_clusterinfo_default($ldb, $rcid, 'lastmt_CMSReceivers', 0, undef);
$attrs = [qw(cstatistic_cid cstatistic_rid blocked receiver)];
PMG::DBTools::copy_selected_data($ldb, $sth, 'CReceivers', $attrs);
-
- PMG::DBTools::write_maxint_clusterinfo ($ldb, $rcid, 'lastid_CStatistic', $maxid);
}
+ PMG::DBTools::write_maxint_clusterinfo ($ldb, $rcid, 'lastid_CStatistic', $maxid);
+
$ldb->commit;
};
if (my $err = $@) {
$mscount += $count;
- last if $mscount >= $maxmails;
-
- } while ($count >= $maxcount);
+ } while (($count >= $maxcount) && ($mscount < $maxmails));
return $mscount;
}
my $merge_sth = $dbh->prepare(
"INSERT INTO UserPrefs (PMail, Name, Data, MTime) " .
- 'VALUES (?, ?, ?, 0) ' .
+ 'VALUES (?, ?, ?, ?) ' .
'ON CONFLICT (PMail, Name) DO UPDATE SET ' .
# Note: MTime = 0 ==> this is just a copy from somewhere else, not modified
'MTime = CASE WHEN excluded.MTime >= UserPrefs.MTime THEN 0 ELSE UserPrefs.MTime END, ' .
my $mergefunc = sub {
my ($ref) = @_;
- $merge_sth->execute($ref->{pmail}, $ref->{name}, $ref->{data});
+ $merge_sth->execute($ref->{pmail}, $ref->{name}, $ref->{data}, $ref->{mtime});
};
return $sync_generic_mtime_db->($dbh, $rdb, $ni, 'UserPrefs', $selectfunc, $mergefunc);