From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Jun 18 12:50:01 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB91E1065675 for ; Wed, 18 Jun 2008 12:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 83C7B8FC1B for ; Wed, 18 Jun 2008 12:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m5ICo11l002338 for ; Wed, 18 Jun 2008 12:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5ICo1fH002337; Wed, 18 Jun 2008 12:50:01 GMT (envelope-from gnats) Resent-Date: Wed, 18 Jun 2008 12:50:01 GMT Resent-Message-Id: <200806181250.m5ICo1fH002337@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Hywel Mallett Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 519EF106564A for ; Wed, 18 Jun 2008 12:45:15 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB4E8FC14 for ; Wed, 18 Jun 2008 12:45:15 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5ICjENT016910 for ; Wed, 18 Jun 2008 12:45:14 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m5ICjEgV016909; Wed, 18 Jun 2008 12:45:14 GMT (envelope-from nobody) Message-Id: <200806181245.m5ICjEgV016909@www.freebsd.org> Date: Wed, 18 Jun 2008 12:45:14 GMT From: Hywel Mallett To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/124713: [patch] postgresql83-server periodic script minor improvements X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2008 12:50:01 -0000 >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: