From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 16:09:14 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 8D9201065670; Thu, 22 Apr 2010 16:09:14 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id EACDC8FC13; Thu, 22 Apr 2010 16:09:13 +0000 (UTC) Received: by ewy24 with SMTP id 24so2536484ewy.33 for ; Thu, 22 Apr 2010 09:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:cc:content-type; bh=Kdv0IBUccvhHQl/4vjXhEhWji0I0Kkym/QDDgJUmx00=; b=QqsZEDUScVGjOQCoekYBaVFb+UQJVqsMLOoGibyhTmwDF6Ey2C0NkKNGgsb3K9GB4w hxgQ2RZ7Nsl1rFAFzHtLBNp1M4aPKRnBF/zu8j2jthBZETGqWiUyn6FfuG23htUupsJs dO5FRfULbBG91k8aiNWJaBoJoJf1/Gkf2nEAM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=EASNJ3MkvGUo5fHIMsapI+8cdBClHZi75k6lH2ZvQ3cWdhjXlQIQtU36OgEKsD31h9 zJh1+nnS6Cql8sbCSpp7gZlnynHimCm9jnrLXbHy0Fbmbqw+TTywD6J71PADOJyNg2cr mVys1DRSWZdwmRZukzey+zB9mUK5ADcat8CMc= MIME-Version: 1.0 Received: by 10.239.193.77 with HTTP; Thu, 22 Apr 2010 09:08:51 -0700 (PDT) In-Reply-To: References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> From: Eitan Adler Date: Thu, 22 Apr 2010 19:08:51 +0300 Received: by 10.239.167.210 with SMTP id h18mr925429hbe.97.1271952552520; Thu, 22 Apr 2010 09:09:12 -0700 (PDT) Message-ID: To: =?UTF-8?Q?Trond_Endrest=C3=B8l?= Content-Type: text/plain; charset=UTF-8 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 16:09:14 -0000 taking into account your feedback here is the new version If all is good I'll submit 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="/var/db/pkg"; bk_loc="$bak/pkgdb.bak.tar" 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:" rm -f $bk_loc tar -cjf $bk_loc $db_loc || rc=3 fi;; *) rc=0;; esac exit $rc