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 1tfjms-004ilh-9c for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 18:06:10 +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 1tfjmr-00Gjbz-Aw for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 18:06:09 +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 1tfjmq-00Gjbr-Vk for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 18:06:08 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tfjmo-003M9q-2t for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 18:06:08 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38db10ab86cso11125f8f.3 for ; Wed, 05 Feb 2025 10:06:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738778765; x=1739383565; darn=lists.postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from:reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/ITp67u38bfVFg1WGTBVVr0wd3LxOEIT4juD0UdNwwk=; b=PAweyY5DMpgDuuTeHmr7caAeG7p7dUD8LvYVIaiGwQ66nLyq1diOcZ3oc8uS2NbS1m Dd5Idrl+CfSe1z1E01RfbchgkDACxgy8B/AZ1Om9SeAKKxzJkuPY/72y2rPR/uWesZV9 JCL5ruuBO5oUqWEfC387yRq6Re17ahcgE89AQJM1PRLbBq3ES0jngKoDHafsCwHyu8xq B8CAUzD//S3f5IVG2tW+bLKFwWasqfz/Lu1Pk9uGCwe16ezqkELMUuHYc84Rcb+enVUZ Ih0wqmM5DixhOwRyUY8OaPhrwzhCtWfU/YZtfdpBfSucEg+ZRcTjUf+McXBdDYTohRC8 6sXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738778765; x=1739383565; h=content-transfer-encoding:to:subject:message-id:date:from:reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/ITp67u38bfVFg1WGTBVVr0wd3LxOEIT4juD0UdNwwk=; b=YDEcy7mmHwuJgkHdJRw7OAF7pYfoQrvyOrBoTYq2iC7RhWQPwh3/Z4QsMYqNhF0QqZ oNdhou2XEaRNkBb7UDpuixKfSpJLoY1UHujjcuijekqSZnpKJeSlikTDW7EHry+0FXoT 4HjudXz9Q3YavnkIkdX/5QRm8z5R7Z7kPA0h0O1gaJ15qUqWpj04oODS/F2JNUqPCNTC OzuLsz+wHSMdd7EmMZJ1ledpjb1ZTvCiQV6DVHAdK8EjRe+cRkTzvHH9kvS424zqaWpX fS0u9LxSEZJMuDK28Wg4DYpkHoolhtX2qJ92IXOBaX/gFTmN3ZpHYumYHphuAd/K/aSN qAXw== X-Gm-Message-State: AOJu0YyK0qNXr7W5fvFHXjU8edENq9TYWkUEy+H58zzdhGwJ3hogucvX p5E1e0vmojgAhk+7jKWTXeoxRugXfGejL7Ozx5MMjbTd9smBK2dNkJzKsbo7csR5oIJmS7pjxzz QVBOOXhm5Q9X+WTvlZbf2etZWc9/KYQUl9KA= X-Gm-Gg: ASbGncu5mfrCEKuodub/RGsQqGyLhXsIKmsBlOyscy5tE/GUdw4lfHquxAtMW1TAHPx NhCD5sNpOBRotIGkDw10YRrX1GuvgIkxb70RcB7v3WSI/hE8b7kY8CmqoPm+Q2gFGgo2wGNmE X-Google-Smtp-Source: AGHT+IG+EhD4pT6LCD/XEjYpSF2dsNE7XygCG+jrYIcrjII1SAaiTAotwkphbVyRPJuV9eUdKTQM16130ssGsgFCsJM= X-Received: by 2002:a5d:69c8:0:b0:386:37f5:99e7 with SMTP id ffacd0b85a97d-38db48f3787mr2740006f8f.33.1738778760717; Wed, 05 Feb 2025 10:06:00 -0800 (PST) MIME-Version: 1.0 Reply-To: csanyipal@gmail.com From: =?UTF-8?B?Q3PDoW55aSBQw6Fs?= Date: Wed, 5 Feb 2025 19:05:49 +0100 X-Gm-Features: AWEUYZkMjo6AKMWCJBHO4mSrFkdEhOcm-WPe4-vbEUDwnbkzUNfmRLBpIPcyLvE Message-ID: Subject: Using PgAgent with SQL commands only? To: pgsql general Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I am using Debian 12 operating system and have installed on it postgresql 15.10 (Debian 15.10-0+deb12u1) and pgagent -V PostgreSQL Scheduling Agent Version: 4.2.2 booth installed with apt. PgAgent is running as service: systemctl status pgagent =E2=97=8F pgagent.service - pgAgent for PostgreSQL Loaded: loaded (/etc/systemd/system/pgagent.service; enabled; preset: enabled) Active: active (running) since Sun 2025-02-02 08:27:43 CET; 3 days ago Process: 92063 ExecStart=3D/usr/bin/pgagent -s ${LOGFILE} -l ${LOGLEVEL} host=3D${DBHOST} dbname=3D${DBNAME} user=3D${DBUSER} port=3D${DBPORT} (code=3Dexited, status=3D0/SUCCESS) Main PID: 92064 (pgagent) Tasks: 1 (limit: 6999) Memory: 4.4M CPU: 10.913s CGroup: /system.slice/pgagent.service =E2=94=94=E2=94=8092064 /usr/bin/pgagent -s /var/log/pgagent/p= gagent.log -l 1 host=3Dlocalhost dbname=3Dpostgres user=3Dpgagent port=3D5432 Because I can't install and run correct PgAdmin 4 on this system I am trying to use PgAgent with SQL commands, so far without any success. I did the following to create a job, jobstep and schedule for that job: (This is just a test for me to see whether I can use PgAgent with SQL comma= nds. This example job should dump my database every five minutes.) For this purpose these are my SQL commands which I did run sofar: sudo su - postgres psql INSERT INTO pgagent.pga_job (jobjclid, jobname, jobdesc, jobhostagent, jobenabled, jobcreated, jobchanged, jobagentid, jobnextrun, joblastrun) VALUES (3, 'otpercenkent_menti_vagyonunk_kezelese_t', '=C3=96tpercenk=C3=A9= nt menti vagyonunk_kezelese adattelepet.', '', TRUE, DEFAULT, DEFAULT, NULL, NULL, NULL); INSERT INTO pgagent.pga_jobstep (jstjobid, jstname, jstdesc, jstenabled, jstkind, jstcode, jstconnstr, jstdbname, jstonerror, jscnextrun) VALUES ((SELECT jobid FROM pgagent.pga_job WHERE jobname =3D 'otpercenkent_menti_vagyonunk_kezelese_t'), 'menti_vagyonunk_kezelese_t', 'Menti vagyonunk_kezelese adattelepet.', TRUE, 'b', '/home/pali/Dokumentumok/AdatTelepeim/PgAgent/PgAgent_Hasznalata/pgag= ent_pg_dump_vagyonunk_kezelese.sh',DEFAULT , '', DEFAULT, NULL); INSERT INTO pgagent.pga_schedule (jscjobid, jscname, jscdesc, jscenabled, jscstart, jscend, jscminutes, jschours, jscweekdays, jscmonthdays, jscmonths) VALUES ((SELECT jobid FROM pgagent.pga_job WHERE jobname =3D 'otpercenkent_menti_vagyonunk_kezelese_t'),'menti_vagyonunk_kezelese_t', 'Menti vagyonunk_kezelese adattelepet.', TRUE, now(), NULL, -- jscminutes [60] '{f,f,f,f,f,t,f,f,f,f,t,f,f,f,f,t,f,f,f,f,t,f,f,f,f,t,f,f,f,f,t,f,f,f,f,t,f= ,f,f,f,t,f,f,f,f,t,f,f,f,f,t,f,f,f,f,t,f,f,f,f}', -- jschours [24] '{t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t}', -- jscweekdays [7] '{t,t,t,t,t,t,t}', -- jscmonthdays [32] '{t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t}', -- jscmonths [12] '{t,t,t,t,t,t,t,t,t,t,t,t}'); So this way I have created a pga_job, a pga_jobstep and a pga_schedule but this job won't run every five minutes. What am I missing here? Any suggestions will be appreciated! --=20 Best, Paul Chany