From owner-svn-src-stable-8@FreeBSD.ORG Sat May 14 21:42:09 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 310E71065686; Sat, 14 May 2011 21:42:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2027F8FC0C; Sat, 14 May 2011 21:42:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ELg9FY017034; Sat, 14 May 2011 21:42:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ELg9RZ017032; Sat, 14 May 2011 21:42:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201105142142.p4ELg9RZ017032@svn.freebsd.org> From: Doug Barton Date: Sat, 14 May 2011 21:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221929 - stable/8/etc/periodic/daily X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 21:42:09 -0000 Author: dougb Date: Sat May 14 21:42:08 2011 New Revision: 221929 URL: http://svn.freebsd.org/changeset/base/221929 Log: MFC r221475: 1. If PKG_DBDIR cannot be determined from make, set the default 2. Add the -H flag to tar in case /var/db/pkg itself is a symlink 3. Direct stderr to /dev/null to suppress the leading slash warning Modified: stable/8/etc/periodic/daily/220.backup-pkgdb Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/periodic/daily/220.backup-pkgdb ============================================================================== --- stable/8/etc/periodic/daily/220.backup-pkgdb Sat May 14 21:34:21 2011 (r221928) +++ stable/8/etc/periodic/daily/220.backup-pkgdb Sat May 14 21:42:08 2011 (r221929) @@ -18,7 +18,8 @@ case "$daily_backup_pkgdb_enable" in bak="${daily_backup_pkgdb_dir:-/var/backups}" bak_file="${bak}/pkgdb.bak.tbz" - pkg_dbdir=`make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null` + pkg_dbdir=`make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null` || + pkg_dbdir=/var/db/pkg if [ ! -d "$bak" ] then @@ -33,7 +34,7 @@ case "$daily_backup_pkgdb_enable" in new_bak_file=`mktemp ${bak_file}-XXXXX` - if tar -cjf "${new_bak_file}" "$pkg_dbdir"; then + if tar -cjHf "${new_bak_file}" "$pkg_dbdir" 2>/dev/null; then chmod 644 "${new_bak_file}" if [ -e "${bak_file}.2" -a -e "${bak_file}" ]; then