Date: Thu, 22 Apr 2010 14:54:02 +0200 From: Lars Engels <lars.engels@0x20.net> To: Eitan Adler <eitanadlerlist@gmail.com> Cc: freebsd-hackers@freebsd.org, Ruben de Groot <mail25@bzerk.org>, Doug Barton <dougb@freebsd.org>, "Aryeh M. Friedman" <aryeh.friedman@gmail.com> Subject: Re: regenerating /var/db/pkg Message-ID: <20100422125402.GR33521@e.0x20.net> In-Reply-To: <o2oa0777e081004220521sae3b1b06o884fd8eadffc6931@mail.gmail.com> References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <o2oa0777e081004220521sae3b1b06o884fd8eadffc6931@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100422125402.GR33521>