From owner-freebsd-questions@FreeBSD.ORG Mon Aug 24 15:57:46 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E3AA106568F for ; Mon, 24 Aug 2009 15:57:46 +0000 (UTC) (envelope-from mkhitrov@gmail.com) Received: from mail-gx0-f227.google.com (mail-gx0-f227.google.com [209.85.217.227]) by mx1.freebsd.org (Postfix) with ESMTP id DFF078FC12 for ; Mon, 24 Aug 2009 15:57:45 +0000 (UTC) Received: by gxk27 with SMTP id 27so2849724gxk.12 for ; Mon, 24 Aug 2009 08:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=j5+2JC7G/7o7Jl2q20SgbdkwKd4nsZcB+7Oe+Rcj3u4=; b=Kh/TNkjf3cb7I9EOMTjUhYItMkQzv57r7OT2nCAwCOaJwpUlqfd+oB3jLAgN/BWOOD LaReP6AwSDXIvRdafV6sBpgzipXRgZog1562iVrx6acq3qwbbvds3lnwVVKyVjvbXfOD ML12CxZctjEhCIuJVEWbpDozb1F7SbjUKbfGA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=nmrntX4frT5N0wCrHg4ky+hIs7TUROJY0wI3jGH8RzwRIpE3gKv0Kr0/I1MPRUZtfd dvxbrjWRHYWteX4K7OYXC8XqM3xBl02cm+RCRAhUl879GjvkG1kky6crUmZM7Ya0v0fb T7pvXqfLkcnVdqJjocg6Pytc/HoGPAi8TdOl8= MIME-Version: 1.0 Received: by 10.91.38.17 with SMTP id q17mr4151672agj.10.1251129465218; Mon, 24 Aug 2009 08:57:45 -0700 (PDT) From: Maxim Khitrov Date: Mon, 24 Aug 2009 11:57:25 -0400 Message-ID: <26ddd1750908240857gb2973b8h7bc06e0a92b82859@mail.gmail.com> To: Free BSD Questions list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Continuous backup of critical system files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2009 15:57:46 -0000 Hello all, I'm setting up a firewall using FreeBSD 7.2 and thought that it may not be a bad idea to have a continuous backup for important files like pf and dnsmasq configurations. By continuous I mean some script that would be triggered every few minutes from cron to automatically create a backup of any monitored file if it was modified. I also have a full system backup in place that is executed daily (dump/restore to a compact flash card), so the continuous backup would really be for times when someone makes a mistake editing one of the config files and needs to revert it to a previous state. My initial thought was to create a mercurial repository at the file system root and exclude everything except for explicitly added files. I'd then run something like "hg commit -m `date`" from cron every 10 minutes to record the changes automatically. Can anyone think of a better way to do this (existing port specifically for this purpose)? Obviously, I need a way to track the history of a file and revert to a previous state quickly. The storage of changes should be as size-efficient as possible. - Max