Re: PgAgent Job Scheduling-Backup - Mailing list pgsql-admin
From | Jayakumar_Mukundaraju |
---|---|
Subject | Re: PgAgent Job Scheduling-Backup |
Date | |
Msg-id | 8BE2E1772BEE8D40B0FB9E59DF2A645E04C4E8A7@hcsmsg002.corp.satyam.ad Whole thread Raw |
In response to | Re: PgAgent Job Scheduling-Backup ("Vishal Arora" <aroravishal22@hotmail.com>) |
List | pgsql-admin |
From: Ashish Karalkar [mailto:ashish.karalkar@info-spectrum.com]
Sent: Tue 7/17/2007 5:33 PM
To: Jayakumar_Mukundaraju
Cc: Vishal Arora
Subject: Re: PgAgent Job Scheduling-Backup
----- Original Message -----From: Jayakumar_MukundarajuSent: Tuesday, July 17, 2007 5:03 PMSubject: PgAgent Job Scheduling-Backup1) Run PgAgent.sql script in maintenance database (Postgres database by >default).I copied that script and executied in Query tool, it is executed and i get that job icon tab.2) Install PgAgent service using the following command on command >prompt -
"C:\Program Files\PostgreSQL\8.2\bin\pgAgent" INSTALL pgAgent -u postgres -p XXXX hostaddr=127.0.0.1 dbname=postgres user=PostgresI installed the pgAgent and it is running..( I checkied in Administrative tool>>Services>>> there PostgreSQL Scheduling Agent >> status is started
Replace the path of pgAgent if you are not using default installation path of PostgresMy pgAgent path is C:\Program FIles\PostgreSQL\8.2\bin\pgAgent
Replace XXXX with the password of OS User Postgres (One given while installing Postgres on windows) ????This is the password of postgres operating system user(Windows ) not the database user postgres.
dbname=postgres (change if your maintenance database is different.)my Maintenance database is postgres.
3) Login using Postgres user account in windows. ?????start>>shutdown>>Logoff your machine and login as postgres user (operating system)
4) Try to access pgAdmin III tool in that login. (These two steps are required to create pgpass.conf file under Postgres login account.)start pgadmin and connect to the server with postgres database user (This will creat automatic pgpass.conf)In pgpass file i have two logins and password, one is server login and another is Account name and password
5) Login back to your normal account.???start>>shutdown>>log off postgres and lagin as a regular user
6) Start pgAgent service using the following command on command prompt Net start pgAgentc:\net start pgAgentThe command promopt is psql to postgresl prompt... postgres-# i entered Net start pgAgent.... The cursor comes next line that is postgres-# promptI entered in postgres-# pg_dump -f "D:\trial.sql" -apostgres -Upostgres... The cursor comes next line that is postgres-# prompt
7) Create a new job using PgAdmin IIIYes i created new jobs name is BACKUP
8) Under step tab click Add to add new step. :- Yes i created new steps
>* Specify some name : step name is B1
>* Kind - SQL / Batch depending upon the kind of job to be performed.
>* Database on which the job is to be performed.
>* Definition tab would contain a SQL command if kind selected is SQL :create a batch file containg following text and save it in the directory D:\test\test.bat@echo off"C:\Program FIles\PostgreSQL\8.2\bin\pg_dump" -U postgres -f D:\test\test.sql -F p -C -d -D postgresand in the defination tab of stpe window write "d:\test\test.bat" and save the tab.- In the step tab Definition place i entered @echo off "C:\Program FIles\PostgreSQL\8.2\bin\pg_dump" -Upostgres -f D:\test\test.sql -F p -C -d -Dpostgres @echo on and saved that tab.
>* Definition tab would contain path of Batch file if kind selected is
>Batch
>9) Under Schedule tab in Job window click Add to add new schedule for the job : - I did it i added BK1 as a schedule name
>* Specify some name
>* Specify the start date & time :- todays date and time is 30mnts
>* Specify the end date and time:- tomorrows date and time is 45 mnts
>* Specify days or weekdays, months when the task needs to be performed in days tab
>* Specify time hours & Minutes when you want the task to be performed. (Atleast One hour & minute to be selected.)
>* Specify exception if any when you do not want the task to be performed.
>10) All set to work.Set the time and check the output in d:\test ditrectoryThis was only i did it.. Kindly guide me where i went wrong....Thanks & RegardsJayakumar MDISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated..
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated..
pgsql-admin by date: