Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jun 2008 12:45:14 GMT
From:      Hywel Mallett <Hywel@hmallett.co.uk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/124713: [patch] postgresql83-server periodic script minor improvements
Message-ID:  <200806181245.m5ICjEgV016909@www.freebsd.org>
Resent-Message-ID: <200806181250.m5ICo1fH002337@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         124713
>Category:       ports
>Synopsis:       [patch] postgresql83-server periodic script minor improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 18 12:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Hywel Mallett
>Release:        7-RELENG
>Organization:
>Environment:
FreeBSD one.option13.co.uk 7.0-STABLE FreeBSD 7.0-STABLE #0: Sun May  4 19:43:28 BST 2008     hywel@one.option13.co.uk:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
postgresql83-server (and ports of other postgresql versions) include a periodic script to perform backups and vacuums of the postgresql databases.
The current script performs vacuums by default. As PostgreSQL now has the autovacuum daemon, the attached patch changes the default to not vacuum.
The attached patch also clarifies some of the script output, and simplifies the command to create the backup directory.
>How-To-Repeat:

>Fix:
See attached patch.

Patch attached with submission follows:

--- 502.pgsql   2008-06-18 12:01:48.000000000 +0100
+++ 502.pgsql.new       2008-06-18 13:17:10.000000000 +0100
@@ -18,9 +18,6 @@
 # daily_pgsql_backup_enable="YES" # do backup
 # daily_pgsql_vacuum_enable="YES" # do vacuum

-daily_pgsql_vacuum_enable="YES"
-daily_pgsql_backup_enable="NO"
-
 daily_pgsql_vacuum_args="-z"
 daily_pgsql_pgdump_args="-b -F c"
 # backupdir is relative to ~pgsql home directory unless it begins with a slash:
@@ -48,11 +45,11 @@
        # but this might not be where you want the backups...
        if [ ! -d ${backupdir} ] ; then
            echo Creating ${backupdir}
-           mkdir ${backupdir}; chmod 700 ${backupdir}; chown pgsql ${backupdir}
+           mkdir -m 700 ${backupdir}; chown pgsql ${backupdir}
        fi

        echo
-       echo "PostgreSQL maintenance"
+       echo "PostgreSQL backups"

        # Protect the data
        umask 077
@@ -83,7 +80,7 @@
     [Yy][Ee][Ss])

        echo
-       echo "vacuuming..."
+       echo "PostgreSQL vacuum"
        su -l pgsql -c "vacuumdb -a -q ${daily_pgsql_vacuum_args}"
        if [ $? -gt 0 ]
        then


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806181245.m5ICjEgV016909>