如何在Postgres中运行通过pgagent创建的作业 [英] How to run a job created via pgagent in Postgres

查看:556
本文介绍了如何在Postgres中运行通过pgagent创建的作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用pgagent创建了一个作业。

Created a job using pgagent.

创建成功,但是无法检查其运行状态。

Successfully it got created but could not check its status if its running or not.

它都没有执行我在步骤中给出的指定代码。

Neither it has performed its specified code which I have given in steps.

使用的版本:
x86_64-pc-linux-gnu上的PostgreSQL 9.6.2,由gcc(GCC)编译4.4.7 20120313(红色Hat 4.4.7-17),64位

借助pgAgent,我创建了一个JOB

With the help of pgAgent I have created a JOB

Job成功创建,但是我无法检查其是否正常工作,因为没有相同的通知,也没有执行我在Job-> Step中传递的SQL代码。

Job successfully got created but I cant check if its working or not as there is no notification for the same, neither it is performing the SQL code which i have passed in Job -> Step.

推荐答案

如果我理解正确,则说明您安装了pgAagent,但是在执行作业时它没有启动。您是否尝试过使用终端启动它?该服务可能已关闭(每次重新启动数据库系统时,我都会手动启动它)。

If I got it right, you installed pgAagent but it is not starting when you execute the jobs. Have you tried starting it using the terminal? The service might be down (I do start it manually every time the database system is restarted).

使用postgres用户...

Using the postgres user ...

sudo su - postgres

。 ..执行以下命令(假设您在数据库服务器上):

... execute the following command (assuming you're on the db server):

pgagent hostaddr=127.0.0.1 dbname=postgres user=postgres -s pgagent_log.log

我希望它会有所帮助。
干杯!

I hope it helps. Cheers!

这篇关于如何在Postgres中运行通过pgagent创建的作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆