vishuaaryan avatar image
vishuaaryan asked

postgres8.4 automate backup command not working in job scheduling

I am using postgresql 8.4 on my windows server 2012. I have made configuration with pgagent for job scheduling. I need to schedule auto backup daily basis on my system using with job scheduling. I searched on net and created a batch file and located the file path in job scheduling. If I run batch file on my server then it works fine but when I call this using scheduling in postgres then it goes in running stage and not give any kind of result. Below command I used for taking backup "c:\Program Files (86)\path\to\bin" pg_dump.exe -i -h hostname -U username -F c -b -v -f "backup\file\path\filename.backup" databasename This command is working fine in command prompt and on calling batch file but not give any output from postgres job scheduling. Any one has any idea about this kind of issue then tell me. Thanks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

are you using the -W option to supply a password? does the pgagent service account have permission to the backup path? can the pgagent service account see the backup path (it's not a mapped drive, for example)? can you redirect the pg_dump output to a file to see if it's asking for more information or trying to return information? You can add " > path\ outputfile.txt" to the command line to do this.
0 Likes 0 ·
@kenj: I also tried with -W option for password in command line in batch file and also tried with another line as set pgpass = "path\to\file\pgpass.conf". This file contains password details and configured with batch file. But issue was the same in both cases and it didnot work for me.
0 Likes 0 ·
How about redirecting the output to a file? Let's make sure it's not trying to tell or ask you something. Maybe try a pg forum - or
0 Likes 0 ·

0 Answers


Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.