Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2010 19:33:48 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Eitan Adler <eitanadlerlist@gmail.com>
Cc:        freebsd-hackers@freebsd.org, Ruben de Groot <mail25@bzerk.org>, "Aryeh M. Friedman" <aryeh.friedman@gmail.com>, =?UTF-8?B?VHJvbmQgRW5kcmVzdMO4bA==?= <Trond.Endrestol@fagskolen.gjovik.no>
Subject:   Re: regenerating /var/db/pkg
Message-ID:  <4BD4FB8C.2050000@FreeBSD.org>
In-Reply-To: <u2sa0777e081004221005ja2bca37ame13007df67898fcd@mail.gmail.com>
References:  <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <o2oa0777e081004220521sae3b1b06o884fd8eadffc6931@mail.gmail.com> <alpine.BSF.2.00.1004221610520.29574@mail.fig.ol.no> <p2oa0777e081004220908w775b40e7r86f0c978b1a05d1e@mail.gmail.com> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> <u2sa0777e081004221005ja2bca37ame13007df67898fcd@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
FWIW, this looks fine to me. Have you submitted a PR?


Doug


On 04/22/10 10:05, Eitan Adler wrote:
> Same as before - if all is good I'll send a PR
> 
> #!/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 $
> #
> 
> # 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
> 
> bak=/var/backups
> db_loc=$(/usr/bin/make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null)
> bk_loc="$bak/pkgdb.bak.tar.bz2"
> 
> 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=2
> 	else
> 	    rc=0
> 
> 	    echo ""
> 	    echo "Backing up package db directory:"
> 
> 	    [ -e $bk_loc ] && unlink $bk_loc
> 	    tar -cjf $bk_loc $db_loc || rc=3
> 	fi;;
> 
>     *)  rc=0;;
> esac
> 
> exit $rc
> 



-- 

	... and that's just a little bit of history repeating.
			-- Propellerheads

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BD4FB8C.2050000>