svn commit: r221930 - stable/7/etc/periodic/daily
Doug Barton
dougb at FreeBSD.org
Sat May 14 21:44:12 UTC 2011
Author: dougb
Date: Sat May 14 21:44:12 2011
New Revision: 221930
URL: http://svn.freebsd.org/changeset/base/221930
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/7/etc/periodic/daily/220.backup-pkgdb
Directory Properties:
stable/7/etc/ (props changed)
Modified: stable/7/etc/periodic/daily/220.backup-pkgdb
==============================================================================
--- stable/7/etc/periodic/daily/220.backup-pkgdb Sat May 14 21:42:08 2011 (r221929)
+++ stable/7/etc/periodic/daily/220.backup-pkgdb Sat May 14 21:44:12 2011 (r221930)
@@ -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
More information about the svn-src-stable-7
mailing list