Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v9Ny0-00HDUs-R1 for pgsql-admin@arkaria.postgresql.org; Thu, 16 Oct 2025 13:24:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v9Nxy-00CxhQ-OL for pgsql-admin@arkaria.postgresql.org; Thu, 16 Oct 2025 13:24:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v9Nxy-00CxhI-Ai for pgsql-admin@lists.postgresql.org; Thu, 16 Oct 2025 13:24:25 +0000 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v9Nxv-0026G1-2Y for pgsql-admin@lists.postgresql.org; Thu, 16 Oct 2025 13:24:24 +0000 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-38627e78203so435621fac.0 for ; Thu, 16 Oct 2025 06:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760621063; x=1761225863; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WqZSRfcAOeQYiLhpt+IIozjYmCAhNPyEwX2cSfnePP8=; b=O0r2+mmEZLXX6++oj4VY7/OHDR65cm2OBxFvwgrxBfUV1ZnCccnPBHmRgwh/YetBGq OP5gEm2TZ7D3t0SGcCDNtbyh3tki4yO3skLSjAaE+Q30mjkcFYHh9VIdMpxQ8owTd0LD 9nAYLZaBmF4ejO8r0A+jMZGKgsWtedETjCXWUSfhP5l7CHI1rb4GY9CI0gDK3SuTItaO 7TZDtfEzAEu6N1Wq1Nq61CCLbRS1w4aZHlchJ6GTG/HSx1fxMW24PpE+W3gSf8BzXU0X Es37BjaLDPF+GY7C/S+OfH+JcLMouVR43rY7dPolF0fwGGBwxligH8j/4wR5qtddVGLJ VVyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760621063; x=1761225863; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WqZSRfcAOeQYiLhpt+IIozjYmCAhNPyEwX2cSfnePP8=; b=L4ruMosj3dpdoOKpdS06t0n6JYLcWv8GiNgAyuIEzvBBuL4wBIeMFZ6UQfoAx4QCxJ ERGXgJq77boNFbFR9WRK3J/34qZN0UyyFISTStac902fq7bPWWlNVWSHvq2ZBhebWx1b /yPA8KSKmGJU5kyNg1yrv5mMHTmSAYX2YUIcwfVjlewIRAEBzaPuWYEtDmcH7OohOMxB 3I11dpof47bKxOE+kHZ1ZiLT7nPTiFCugizfGTLU58fFLGdyZO9L0Q6Ac1dQtTHpBFew qLm0R6ovo/wss9L0jvqFW0BKBLUMSYXP44F9qoK8vxiHyoceOkvHfOLtFaaypGmmTHSC kHxg== X-Gm-Message-State: AOJu0YxjIlqf1571WxUaBlFV1Oy2cvBMOxdN6sgZRxFORiU721fvKzLg f4hKfJ9xghFY3IMfDJ9ab+1ClpfvjB9UEjBEyE5g5eSzk2QTGCVmEsCMHz36sXbMmVZbe3hjH5I vaWCYf++EC9q/XilqU0fNutDdd6TE+45PHA== X-Gm-Gg: ASbGncs/Gbve6cy1jaEnUZua4S/eHHzWdpIEZXW6ZcjiqN69icw2Ljo+iGmKJTbRLsH 1xeho+1xD+MLFYUN5KCldGVJDksvxCowJLYQIhxWTlDM0nmlYAQ8yQE4GzUg9mL7ADrCmsWKnJl j9SFtpjE2i90OnoNcmqgOnnNSZ60oXq2o6ed8XRDfIqhdWpYtT1NEaSNxxDShKuc0mnwtczly+m hlcGAKOUKKbJj4mcAEKl0KYi98CHdO6IoPPjq0n0gmYfszqIJNeBSsn+xNQdzvZ9bSgpn8c11qA z8Xtdwi+Y2Wo+y7jogxmWt5FsDAdew== X-Google-Smtp-Source: AGHT+IEFBdljQdjGr/+FIvrLOAeFTi0UYRipgHywQie//nXgVBhLlQI4d+U3ULyEnJEjbeOhXuzzEFiryCGgOs2HkPg= X-Received: by 2002:a05:6870:5b26:b0:3c9:8ae9:b84b with SMTP id 586e51a60fabf-3c98ae9baa1mr61263fac.18.1760621062817; Thu, 16 Oct 2025 06:24:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Keith Christian Date: Thu, 16 Oct 2025 07:24:12 -0600 X-Gm-Features: AS18NWDCjCipakT05Ke5uuhWiIpr-JC4nCalr1CaCxdGq8J-4srxKgVtZaF9umY Message-ID: Subject: Re: Looking for a linux tool to automate PG admin tasks To: Jean-Christophe Boggio Cc: pgsql-admin Content-Type: multipart/alternative; boundary="000000000000088ae40641468949" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000088ae40641468949 Content-Type: text/plain; charset="UTF-8" Expect comes to mind. I've automated many CLI based systems with it. ------Keith On Thu, Oct 16, 2025, 07:17 Jean-Christophe Boggio < postgresql@thefreecat.org> wrote: > Hello, > I have several servers with many databases on them for different > applications. > I need to execute some tasks on some databases depending on some criteria. > > For example, execute query xxx but only on databases where table > public.sometable exists or if number of rows in table yyy is > 1M. > Before reinventing the wheel with ugly bash scripts, do you know of some > tools that would suit my case ? > Some tasks will have to execute periodically (with crons probably) and > others will be one-off. > CLI tools if possible because I'm working remotely on those servers of > course. > Thanks, > JC > > > > --000000000000088ae40641468949 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Expect comes to mind.
I've automated= many CLI based systems with it.
------Keith



On Thu, Oct 16, 2025, 07:17 Jean-Christophe Boggio <postgresql@thefreecat.org> wrote:
<= /div>
Hello,
I have several servers with many databases on them for different
applications.
I need to execute some tasks on some databases depending on some criteria.<= br>
For example, execute query xxx but only on databases where table
public.sometable exists or if number of rows in table yyy is > 1M.
Before reinventing the wheel with ugly bash scripts, do you know of some tools that would suit my case ?
Some tasks will have to execute periodically (with crons probably) and
others will be one-off.
CLI tools if possible because I'm working remotely on those servers of =
course.
Thanks,
JC



--000000000000088ae40641468949--