pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[Question][PGAgent][Jobs] - Problems running sh scripts on remote Server
3+ messages / 2 participants
[nested] [flat]

* [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server
@ 2021-02-03 10:13 João Gaspar <joao.f.r.gaspar@gmail.com>
  2021-02-03 10:17 ` Re: [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server Ron <ronljohnsonjr@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: João Gaspar @ 2021-02-03 10:13 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi to all,
I'm a young padawan in RHEL PostgreSQL configurations.
My past experience was in Windows Server with .bat scripts.

My Environment specs:
Client OS: Win10 Pro
PgAdmin 4.30

Remote Server with PG
Remote OS: RHEL8.3
PG Version: 13.1
PG Agent: 4.0

Background history:
I set up pgagent based on this adapted to pg_agent13 and documentation:
https://www.pgadmin.org/docs/pgadmin4/development/using_pgagent.html

https://stackoverflow.com/questions/52168081/systemd-unit-for-pgagent

My job is a sh script that makes the daily backups. I test the script and
run as expected on a remote server but when configure the job in PgAdmin
Win10 Client using in the Code box /pathtoscript/script.sh isn´t working
when I click on Run Now.

I try to put:

sh /pathtoscript/script.sh - Don't do anything to the folder of backups

/pathtoscript/script.sh - Don't do anything to the folder of backups


Checking  the /var/log/pgagent_13.log I see that pgagent establish the
connection and Execute the job:

Wed Feb 3 10:04:00 2021 DEBUG: Creating DB connection: user=postgres
 hostaddr=127.0.0.1 port=5432 dbname=postgres

Wed Feb 3 10:04:00 2021 DEBUG: Parsing connection information...
Wed Feb 3 10:04:00 2021 DEBUG: Allocating new connection for the database
with connection string: user=postgres dbname=postgres hostaddr=127.0.0.1
port=5432...
Wed Feb 3 10:04:00 2021 DEBUG: Starting job: 1
Wed Feb 3 10:04:00 2021 DEBUG: Executing batch step1(part of job 1)
Wed Feb 3 10:04:00 2021 DEBUG: Creating primary connection
Wed Feb 3 10:04:00 2021 DEBUG: Parsing connection information...
Wed Feb 3 10:04:00 2021 DEBUG: user: postgres
Wed Feb 3 10:04:00 2021 DEBUG: dbname: postgres
Wed Feb 3 10:04:00 2021 DEBUG: hostaddr: 127.0.0.1
Wed Feb 3 10:04:00 2021 DEBUG: port: 5432
Wed Feb 3 10:04:00 2021 DEBUG: Creating DB connection: user=postgres
 hostaddr=127.0.0.1 port=5432 dbname=postgres
Wed Feb 3 10:04:00 2021 DEBUG: Database sanity check
Wed Feb 3 10:04:00 2021 DEBUG: Clearing zombies
Wed Feb 3 10:04:00 2021 DEBUG: Checking for jobs to run
Wed Feb 3 10:04:00 2021 DEBUG: Sleeping...

My question this can be a read/write permissions on destination folder to
the user pgagent?

Thank you for your time and I'm sorry if I'm asking a silly question.

Best regards,
João Gaspar

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server
  2021-02-03 10:13 [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server João Gaspar <joao.f.r.gaspar@gmail.com>
@ 2021-02-03 10:17 ` Ron <ronljohnsonjr@gmail.com>
  2021-02-03 11:00   ` Re: [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server João Gaspar <joao.f.r.gaspar@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ron @ 2021-02-03 10:17 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

You'll probably have better luck asking a pgadmin list: 
https://www.pgadmin.org/support/list/.

On 2/3/21 4:13 AM, João Gaspar wrote:
> Hi to all,
> I'm a young padawan in RHEL PostgreSQL configurations.
> My past experience was in Windows Server with .bat scripts.
>
> My Environment specs:
> Client OS: Win10 Pro
> PgAdmin 4.30
>
> Remote Server with PG
> Remote OS: RHEL8.3
> PG Version: 13.1
> PG Agent: 4.0
>
> Background history:
> I set up pgagent based on this adapted to pg_agent13 and documentation:
> https://www.pgadmin.org/docs/pgadmin4/development/using_pgagent.html
>
> https://stackoverflow.com/questions/52168081/systemd-unit-for-pgagent
>
> My job is a sh script that makes the daily backups. I test the script and 
> run as expected on a remote server but when configure the job in PgAdmin 
> Win10 Client using in the Code box /pathtoscript/script.sh isn´t working 
> when I click on Run Now.
>
> I try to put:
>
> sh /pathtoscript/script.sh - Don't do anything to the folder of backups
>
> /pathtoscript/script.sh - Don't do anything to the folder of backups
>
>
> Checking the /var/log/pgagent_13.log I see that pgagent establish the 
> connection and Execute the job:
>
> Wed Feb 3 10:04:00 2021 DEBUG: Creating DB connection: user=postgres 
>  hostaddr=127.0.0.1 port=5432 dbname=postgres
>
> Wed Feb 3 10:04:00 2021 DEBUG: Parsing connection information...
> Wed Feb 3 10:04:00 2021 DEBUG: Allocating new connection for the database 
> with connection string: user=postgres dbname=postgres hostaddr=127.0.0.1 
> port=5432...
> Wed Feb 3 10:04:00 2021 DEBUG: Starting job: 1
> Wed Feb 3 10:04:00 2021 DEBUG: Executing batch step1(part of job 1)
> Wed Feb 3 10:04:00 2021 DEBUG: Creating primary connection
> Wed Feb 3 10:04:00 2021 DEBUG: Parsing connection information...
> Wed Feb 3 10:04:00 2021 DEBUG: user: postgres
> Wed Feb 3 10:04:00 2021 DEBUG: dbname: postgres
> Wed Feb 3 10:04:00 2021 DEBUG: hostaddr: 127.0.0.1
> Wed Feb 3 10:04:00 2021 DEBUG: port: 5432
> Wed Feb 3 10:04:00 2021 DEBUG: Creating DB connection: user=postgres 
>  hostaddr=127.0.0.1 port=5432 dbname=postgres
> Wed Feb 3 10:04:00 2021 DEBUG: Database sanity check
> Wed Feb 3 10:04:00 2021 DEBUG: Clearing zombies
> Wed Feb 3 10:04:00 2021 DEBUG: Checking for jobs to run
> Wed Feb 3 10:04:00 2021 DEBUG: Sleeping...
>
> My question this can be a read/write permissions on destination folder to 
> the user pgagent?
>
> Thank you for your time and I'm sorry if I'm asking a silly question.
>
>
> Best regards,
> João Gaspar

-- 
Angular momentum makes the world go 'round.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server
  2021-02-03 10:13 [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server João Gaspar <joao.f.r.gaspar@gmail.com>
  2021-02-03 10:17 ` Re: [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server Ron <ronljohnsonjr@gmail.com>
@ 2021-02-03 11:00   ` João Gaspar <joao.f.r.gaspar@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: João Gaspar @ 2021-02-03 11:00 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org

Hi Ron,
Thank you for your quick feedback.

I'm sorry for the noise.

Best regards,
João Gaspar


Ron <ronljohnsonjr@gmail.com> escreveu no dia quarta, 3/02/2021 à(s) 10:18:

> You'll probably have better luck asking a pgadmin list:
> https://www.pgadmin.org/support/list/.
>
> On 2/3/21 4:13 AM, João Gaspar wrote:
>
> Hi to all,
> I'm a young padawan in RHEL PostgreSQL configurations.
> My past experience was in Windows Server with .bat scripts.
>
> My Environment specs:
> Client OS: Win10 Pro
> PgAdmin 4.30
>
> Remote Server with PG
> Remote OS: RHEL8.3
> PG Version: 13.1
> PG Agent: 4.0
>
> Background history:
> I set up pgagent based on this adapted to pg_agent13 and documentation:
> https://www.pgadmin.org/docs/pgadmin4/development/using_pgagent.html
>
> https://stackoverflow.com/questions/52168081/systemd-unit-for-pgagent
>
> My job is a sh script that makes the daily backups. I test the script and
> run as expected on a remote server but when configure the job in PgAdmin
> Win10 Client using in the Code box /pathtoscript/script.sh isn´t working
> when I click on Run Now.
>
> I try to put:
>
> sh /pathtoscript/script.sh - Don't do anything to the folder of backups
>
> /pathtoscript/script.sh - Don't do anything to the folder of backups
>
>
> Checking  the /var/log/pgagent_13.log I see that pgagent establish the
> connection and Execute the job:
>
> Wed Feb 3 10:04:00 2021 DEBUG: Creating DB connection: user=postgres
>  hostaddr=127.0.0.1 port=5432 dbname=postgres
>
> Wed Feb 3 10:04:00 2021 DEBUG: Parsing connection information...
> Wed Feb 3 10:04:00 2021 DEBUG: Allocating new connection for the database
> with connection string: user=postgres dbname=postgres hostaddr=127.0.0.1
> port=5432...
> Wed Feb 3 10:04:00 2021 DEBUG: Starting job: 1
> Wed Feb 3 10:04:00 2021 DEBUG: Executing batch step1(part of job 1)
> Wed Feb 3 10:04:00 2021 DEBUG: Creating primary connection
> Wed Feb 3 10:04:00 2021 DEBUG: Parsing connection information...
> Wed Feb 3 10:04:00 2021 DEBUG: user: postgres
> Wed Feb 3 10:04:00 2021 DEBUG: dbname: postgres
> Wed Feb 3 10:04:00 2021 DEBUG: hostaddr: 127.0.0.1
> Wed Feb 3 10:04:00 2021 DEBUG: port: 5432
> Wed Feb 3 10:04:00 2021 DEBUG: Creating DB connection: user=postgres
>  hostaddr=127.0.0.1 port=5432 dbname=postgres
> Wed Feb 3 10:04:00 2021 DEBUG: Database sanity check
> Wed Feb 3 10:04:00 2021 DEBUG: Clearing zombies
> Wed Feb 3 10:04:00 2021 DEBUG: Checking for jobs to run
> Wed Feb 3 10:04:00 2021 DEBUG: Sleeping...
>
> My question this can be a read/write permissions on destination folder to
> the user pgagent?
>
> Thank you for your time and I'm sorry if I'm asking a silly question.
>
> Best regards,
> João Gaspar
>
>
> --
> Angular momentum makes the world go 'round.
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-02-03 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 10:13 [Question][PGAgent][Jobs] - Problems running sh scripts on remote Server João Gaspar <joao.f.r.gaspar@gmail.com>
2021-02-03 10:17 ` Ron <ronljohnsonjr@gmail.com>
2021-02-03 11:00   ` João Gaspar <joao.f.r.gaspar@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox