I use this one, after having asked on the list for this kind of stuff. It only does vacuum, because backup may be a lot
morespecific for each one.
It works on RedHat :
========================================
[root@fleurance cron.daily]# cat /etc/cron.daily/postgresql
#!/bin/sh
su postgres -c 'psql -t -c "select datname from pg_database order by datname;" template1 | xargs -n 1 psql -q -c
"vacuumanalyze;"'
[root@fleurance cron.daily]#
========================================
RedHat has the gentle facility to run every script in /etc/cron.daily, each day, according to this crontab :
========================================
[root@fleurance /etc]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
[root@fleurance /etc]#
========================================
Yours,
Nicolas huillard
-----Message d'origine-----
De: Bruce Bantos [SMTP:anon@mgfairfax.rr.com]
Date: jeudi 27 janvier 2000 17:35
À: pgsql-general@postgreSQL.org
Objet: [GENERAL] backup/maintenance scripts?
I asked a similar question yesterday about scheduling backups and vacuum,
but I thought I would make a more direct request:
Does anyone have an example of a postgreSQL scheduled maintenance script
(cron job, other) that they would care to share with the list? An example of
a script that performs vacuums, creates backups, etc would be great. Perhaps
we could add a section on routine maintenance in the docs and include a good
script example.
Thanks,
Bruce
************