Fix log truncation

Syslog wasn't truncated which caused massive disk space usage when the
full test set was run.
This commit is contained in:
Markus Mäkelä 2019-03-09 17:16:37 +02:00
parent 160b4e6e05
commit c132125d55
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -1146,13 +1146,13 @@ int Mariadb_nodes::truncate_mariadb_logs()
int local_result = 0;
for (int node = 0; node < N; node++)
{
char sys[1024];
if (strcmp(IP[node], "127.0.0.1") != 0)
{
sprintf(sys,
"ssh -i %s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet %s@%s 'sudo truncate /var/lib/mysql/*.err --size 0;sudo rm -f /etc/my.cnf.d/binlog_enc*\' &",
sshkey[node], access_user[node], IP[node]);
local_result += system(sys);
local_result += ssh_node_f(node, true,
"truncate -s 0 /var/lib/mysql/*.err;"
"truncate -s 0 /var/log/syslog;"
"truncate -s 0 /var/log/messages;"
"rm -f /etc/my.cnf.d/binlog_enc*;");
}
}
return local_result;