[GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-16 Thread Tom Hart
Hello everybody. I'm having a bit of trouble automating pg_dumpall to do nightly backups. I have a batch file whose contents are below SET PGPASSFILE=C:\foo\bar\PG_BACKUP\PGPASSFILE\pgpass.conf "C:\Program Files\PostgreSQL\8.2\bin\pg_dumpall.exe" -U foo_postgres > C:\foo\bar\PG_BACKUP\db.out

Re: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-15 Thread Tom Hart
Martin Gainty wrote: Hi Tom In windows you would need to include the runas command so your bat file needs to execute the command via runas as in runas /user:postgres "bin\pg_dumpall.exe -U foo_postgres" HTH Martin Actually, schtasks.exe and the windows task scheduler both have this functionali

Re: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-15 Thread Martin Gainty
ot;Postgres General List" Sent: Thursday, November 15, 2007 5:07 PM Subject: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall > Hello everybody. I'm having a bit of trouble automating pg_dumpall to do > nightly backups. I have a batch file whose contents ar

Re: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-15 Thread Tom Hart
Tom Hart wrote: [EMAIL PROTECTED] wrote: One other oddity I ran into recently on one system only, is that a perl program (.pl extension) worked fine from the command-line, double-clicked on, etc. but in the scheduled job, I had to put "perl xxx.pl" for it to work. Maybe if all else fails, try

Re: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-15 Thread Tom Lane
Tom Hart <[EMAIL PROTECTED]> writes: > Do scheduled tasks > have a problem writing to files with > ? I tried an "echo this is a test > > test.txt" and that didn't run either. I know zip about Windows, but try using pg_dump's -f switch instead of ">" and see if it gets happier.

Re: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-15 Thread Tom Hart
[EMAIL PROTECTED] wrote: One other oddity I ran into recently on one system only, is that a perl program (.pl extension) worked fine from the command-line, double-clicked on, etc. but in the scheduled job, I had to put "perl xxx.pl" for it to work. Maybe if all else fails, try "cmd.exe xxx.ba

Re: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-15 Thread SCassidy
[EMAIL PROTECTED] wrote on 11/15/2007 02:07:07 PM: > Hello everybody. I'm having a bit of trouble automating pg_dumpall to do > nightly backups. I have a batch file whose contents are below > > SET PGPASSFILE=C:\foo\bar\PG_BACKUP\PGPASSFILE\pgpass.conf > "C:\Program Files\PostgreSQL\8.2\bin\pg_

Re: [GENERAL] automating backups with windows scheduled tasks and pg_dumpall

2007-11-15 Thread Tom Hart
Tom Lane wrote: Tom Hart <[EMAIL PROTECTED]> writes: Do scheduled tasks have a problem writing to files with > ? I tried an "echo this is a test test.txt" and that didn't run either. I know zip about Windows, but try using pg_dump's -f switch instead of ">" and see if it gets