From 80165978d3043829a6c92339e4a9a230015b5528 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 10 Aug 2022 13:38:01 +0000 Subject: [PATCH] fix cleanup --- apps/api/src/routes/api/v1/services/handlers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/routes/api/v1/services/handlers.ts b/apps/api/src/routes/api/v1/services/handlers.ts index 829b5d88b..53601e2fa 100644 --- a/apps/api/src/routes/api/v1/services/handlers.ts +++ b/apps/api/src/routes/api/v1/services/handlers.ts @@ -2666,7 +2666,7 @@ export async function cleanupPlausibleLogs(request: FastifyRequest, repl if (destinationDockerId) { await executeDockerCmd({ dockerId: destinationDocker.id, - command: `docker exec ${id}-clickhouse /usr/bin/clickhouse-client -q "SELECT name FROM system.tables WHERE name LIKE '%log%';" | xargs -I{} /usr/bin/clickhouse-client -q "TRUNCATE TABLE system.{};"` + command: `docker exec ${id}-clickhouse sh -c "/usr/bin/clickhouse-client -q \"SELECT name FROM system.tables WHERE name LIKE '%log%';\"| xargs -I{} /usr/bin/clickhouse-client -q \"TRUNCATE TABLE system.{};\""` }) return await reply.code(201).send() }