RE: [GENERAL] backup/maintenance scripts?

From: Nicolas Huillard <nhuillard(at)ghs(dot)fr>
To: "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: RE: [GENERAL] backup/maintenance scripts?
Date: 2000-01-27 17:12:34
Message-ID: 01BF68F2.16CD7080@agen.int.ghs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 more specific for each one.
It works on RedHat :

========================================
[root(at)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 "vacuum analyze;"'
[root(at)fleurance cron.daily]#
========================================

RedHat has the gentle facility to run every script in /etc/cron.daily, each day, according to this crontab :

========================================
[root(at)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(at)fleurance /etc]#
========================================

Yours,

Nicolas huillard

-----Message d'origine-----
De: Bruce Bantos [SMTP:anon(at)mgfairfax(dot)rr(dot)com]
Date: jeudi 27 janvier 2000 17:35
À: pgsql-general(at)postgreSQL(dot)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

************

Browse pgsql-general by date

  From Date Subject
Next Message bgpyvd 2000-01-27 17:18:18 18 yr. old blonde 8046
Previous Message Mel Wilson 2000-01-27 17:08:50 Re: [GENERAL] Trouble: subquery doesn't terminate