From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 12:54:03 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7BF1106564A; Thu, 22 Apr 2010 12:54:03 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id 66DE38FC12; Thu, 22 Apr 2010 12:54:03 +0000 (UTC) Received: by mail.0x20.net (Postfix, from userid 1002) id 38B2B3A601; Thu, 22 Apr 2010 14:54:02 +0200 (CEST) Date: Thu, 22 Apr 2010 14:54:02 +0200 From: Lars Engels To: Eitan Adler Message-ID: <20100422125402.GR33521@e.0x20.net> References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sgof50bbbY3Ojj4a" Content-Disposition: inline In-Reply-To: X-Editor: VIM - Vi IMproved 7.2 X-Operation-System: FreeBSD 5.5-RELEASE-p19 User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Thu, 22 Apr 2010 13:20:25 +0000 Cc: freebsd-hackers@freebsd.org, Ruben de Groot , Doug Barton , "Aryeh M. Friedman" Subject: Re: regenerating /var/db/pkg X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2010 12:54:03 -0000 --sgof50bbbY3Ojj4a Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 22, 2010 at 03:21:16PM +0300, Eitan Adler wrote: > > > > Just asking opinions, if people want this, I'll make a patch and > > file a PR. > > >=20 > Is this script correct? >=20 > #!/bin/sh > # > # $FreeBSD: src/etc/periodic/daily/210.backup-aliases,v 1.6.36.1.2.1 > 2009/10/25 01:10:29 kensmith Exp $ > # >=20 > # If there is a global system configuration file, suck it in. > # > if [ -r /etc/defaults/periodic.conf ] > then > . /etc/defaults/periodic.conf > source_periodic_confs > fi >=20 > bak=3D/var/backups > db_loc=3D"/var/db/pkg"; > bk_loc=3D"/$bak/pkgdb.bak.tar" >=20 > case "$daily_backup_pkgdb_enable" in > [Yy][Ee][Ss]) > if [ ! -d $db_loc ] > then > echo '$daily_backup_pkgdb_enable is enabled but' \ > "$db_loc doesn't exist" > rc=3D2 > else > rc=3D0 >=20 > echo "" > echo "Backing up mail aliases:" >=20 > if [ ! -f $bk_loc ] > then > echo "no $bk_loc" > tar -cjf $bk_loc $db_loc || rc=3D3 > fi > fi;; >=20 > *) rc=3D0;; > esac >=20 > exit $rc Hmm, I guess you shouldn't backup /var/foo to /var/bar. If /var is lost, your backup is gone, too. --sgof50bbbY3Ojj4a Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkvQRukACgkQKc512sD3afhefwCgsq8KONx3oVGoYpToccfBbsSC glEAniPHuePi8zmjJQhHbZvM8EXZr451 =n+g7 -----END PGP SIGNATURE----- --sgof50bbbY3Ojj4a--