automating backups with windows scheduled tasks and pg_dumpall

From: Tom Hart <tomhart(at)coopfed(dot)org>
To: Postgres General List <pgsql-general(at)postgresql(dot)org>
Subject: automating backups with windows scheduled tasks and pg_dumpall
Date: 2007-11-15 22:07:07
Message-ID: 473CC30B.8090809@coopfed.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Now this file, when I double click on the .bat, works wonderfully. It
sets the variable correctly, reads the pw file with no problem, and
performs the dump. However when this same bat is built into a scheduled
task (same username, administrator in both cases), even though the task
claims to have completed correctly, I have no evidence of it running,
and it certainly isn't doing the backup.

I'm sure many of you have experience in scheduling backups in this
manner (though admittedly a large number of you are probably using cron
in *nix). Is there anything that jumps out at you? 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. What's confusing is that
windows is claiming everything ran fine, in under 5 seconds no less (my
db isn't that big, but it takes longer than that to dump the entire
thing). Any ideas?

TIA

Thomas R. Hart II
tomhart(at)coopfed(dot)org

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-11-15 22:08:10 Re: Variable LIMIT and OFFSET in SELECTs
Previous Message Alvaro Herrera 2007-11-15 21:59:08 Re: 8.3 vs 8.2 sql compatiblity issue