[Zope] running pg_dump on windows as external method

Andreas Jung lists at zopyx.com
Fri Oct 26 00:24:16 EDT 2007




--On 25. Oktober 2007 22:48:42 +0100 Garry Saddington 
<garry at schoolteachers.co.uk> wrote:

> I am using zope on windows with an external python method to backup my
> database. I am struggling to run the following command:
>
> pg_dump.exe database > file
>
> I have tried using os.popen - no luck
> and also subprocess.Popen.
>
> eg:
> import subprocess
>        
> subprocess.Popen(['c:/dir/dir/pg_dump.exe','database','>','c:/dir/dir/out
> put  file'])
>

- play with the shell=True|False parameter of Popen()
- why do you use redirection since Popen() provides a proper mechansim for
  reading stderr/stdout
- where is your code where you are calling wait()???

Please try again...

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20071026/968c0e8a/attachment.bin


More information about the Zope mailing list