473,466 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

job won't work on pgagent schedule

51 New Member
I installed pgagent in a windows 7. On pgadmin3, I can see JOB. And I create a simple Job on it to run a simple batch file, just one line, echo ZZZ. I try to "run now". it won't work at all. I check pgAgent service, it's running. And run by a PC account who can access the batch file. Just don't what else I have missed out!
Nov 17 '10 #1
4 6362
rski
700 Recognized Expert Contributor
just one line, echo ZZZ
You mean the job you define put string ZZZ on standard output?
You want postgres job write some where?, on the terminal? What for?
It is not what the job was "invented" for. Job usually do some database things (puit data into tables, update some data etc.).
Nov 18 '10 #2
datactrl
51 New Member
I have a script to run pg_dumpall and pg_dump modified from pgAgent installation document. It won't work at all. That why I try a simple script just echo something to see if it works. The script is as the following. It works when I run it on command windows.

Expand|Select|Wrap|Line Numbers
  1. set BACKUPDIR=D:\cij\works\backup\
  2. set PGHOST=localhost
  3. set PGUSER=quals
  4. set PGBIN=C:\Program Files (x86)\PostgreSQL\8.3\bin\
  5.  
  6. rem date format: dd/mm/yy
  7. for /f "tokens=1-3 delims=/ " %%i in ("%date%") do (
  8.  set day=%%i
  9.  set month=%%j
  10.  set year=%%k
  11. )
  12.  
  13. rem tiem format: hh:mm:ss
  14. for /f "tokens=1-3 delims=: " %%i in ("%time%") do (
  15.  set hh=%%i
  16.  set nn=%%j
  17. )
  18. echo %year% %month% %day% %hh% %mm%
  19.  
  20. "%PGBIN%pg_dumpall" -h %PGHOST% -p 5234 -U %PGUSER% -f "%BACKUPDIR%fullpgbackup-%year%%month%.sql"
  21. "%PGBIN%pg_dump" -i -h %PGHOST% -p 5234 -U %PGUSER% -F c -b -v -f "%BACKUPDIR%cijquals-%year%%month%%day%%hh%.compressed" cijquals
Nov 19 '10 #3
rski
700 Recognized Expert Contributor
Put some debug log into this script (write some debug to log file) and check if there appear some logs when you call that job from pgagent
Nov 19 '10 #4
datactrl
51 New Member
Thank you, rski. I changed my scripts as followings which has some point to output log on a text file, t1.txt. I run it from command window with the same login user as pgAgent service. It works and t1.txt is output correctly. While on pgAgent, I click 'Run now'. there is just nothing happened. And no output log as well. I check the statistic, there is no any entry on it. It seems pgAgent didn't run it at all.

Expand|Select|Wrap|Line Numbers
  1. echo start here >t1.txt
  2. set BACKUPDIR=D:\cij\works\backup\
  3. set PGHOST=localhost
  4. set PGUSER=quals
  5. set PGBIN=C:\Program Files (x86)\PostgreSQL\8.3\bin\
  6.  
  7. rem date format: dd/mm/yy
  8. for /f "tokens=1-3 delims=/ " %%i in ("%date%") do (
  9.  set day=%%i
  10.  set month=%%j
  11.  set year=%%k
  12. )
  13. echo %year% %month% %day% >>t1.txt
  14. rem tiem format: hh:mm:ss
  15. for /f "tokens=1-3 delims=: " %%i in ("%time%") do (
  16.  set hh=%%i
  17.  set mm=%%j
  18. )
  19. echo  %hh% %mm% >>t1.txt
  20.  
  21. "%PGBIN%pg_dumpall" -h %PGHOST% -p 5234 -U %PGUSER% -f "%BACKUPDIR%fullpgbackup-%year%%month%.sql"
  22. "%PGBIN%pg_dump" -i -h %PGHOST% -p 5234 -U %PGUSER% -F c -b -v -f "%BACKUPDIR%cijquals-%year%%month%%day%%hh%.compressed" cijquals
Nov 22 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jim | last post by:
Hey guys I DESPERATLY need some help with this small javascript i have on this website. All that it's supposed to do is change the button image once it's pressed but alas... I copy-pasted the code...
4
by: Mark | last post by:
the Following bit of code doesn't work. It seems to respond to the second, starting with 'add iif statement for Good Practice', but not to the first, starting 'add iif statement for archived' ...
4
by: Chad | last post by:
I have a link (.ascx) and that generates an Add form on that page. The autopostback dropdown is within a "If Not IsPostBack Then" statement. The form that is created is all via static html in the...
7
by: simon | last post by:
I have simple html(aspx) page, but vertical height won't work. Even if i had set the height of a table=100%, the table is not 100% height. I spend a lot of time(my real page is more...
3
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
6
by: b. hotting | last post by:
Hi, I don't see why this won't work, it are 3 links, the last one (a get) does work, but the first 2 won't. i would like to use a post, through hidden input types any idea? thanks for your...
1
by: Luciano Resende | last post by:
I'm trying to perform a webDav call to move selected messages into a destination folder and does anybody know why BMOVE will work when i use the regular folder name as the request parameters, and...
7
by: Eran.Yasso | last post by:
Hi, I have project that automate excel(using Excel COM) which works fine in my home. I took the project from my home to work and tried to build the project but it won't built. I get error "The...
2
by: Matthew Wells | last post by:
Hello. I'm reposting this because my prioe post's subject line was incorrect. I'm developing an asp.net 2.0 project using VS 2005 on XP sp2 with all the updates. I have an aspx page with...
4
by: z55177 | last post by:
My domain: http://www.esthevision.cz/ This is the cause of my problem. The template is supposed to look somewhat like this: PINK STRIPE http://themebot.com/website-templates/ht... I created an...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.