From owner-freebsd-stable@FreeBSD.ORG Fri Jun 22 07:52:40 2007 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 68F9416A400 for ; Fri, 22 Jun 2007 07:52:40 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id F23C413C45A for ; Fri, 22 Jun 2007 07:52:39 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (fwnetw@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l5M7qXII034359; Fri, 22 Jun 2007 09:52:38 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l5M7qW8W034358; Fri, 22 Jun 2007 09:52:32 +0200 (CEST) (envelope-from olli) Date: Fri, 22 Jun 2007 09:52:32 +0200 (CEST) Message-Id: <200706220752.l5M7qW8W034358@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, matrix@itlegion.ru In-Reply-To: <04e601c7b356$b47cddf0$0c00a8c0@Artem> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 22 Jun 2007 09:52:38 +0200 (CEST) Cc: Subject: Re: When inode change time changes? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, matrix@itlegion.ru List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2007 07:52:40 -0000 Artem Kuchin wrote: > Also, i use inode time because i only need files > which really have been changed. For example, > i you restore a file from a month ago it will have > a date which is a month ago. Then that backup > is destroyed but this file would not be backed up > because the date is too much in the past. So, we > loose the file. If i used inode change time the file > will be backup in any case. However, some > "stupid" programs like mysql or qmail seem to > touch files so, Pretty much _any_ operation on a file (except reading it) will update the ctime of the inode. So I'm not surprised that the ctime of database files and mail files gets updated often. (However, I do agree that mysql and qmail are "stupid", but for entirely different reasons. ;-) > for example, all mail message and > databases are backed up every time. And this sucks. Seems like you need to make a distinction: Use mtime for /var/mail and /var/db/mysql/data (or wherever your db files are), and use ctime for everything else. With find(1) and bsdtar(1) that's pretty easy: # set -f # disable shell-expansion of "*" # MDIRS="( -path ./var/mail/* -o -path /var/db/mysql/data/* )" # FLAG="/var/db/lastbackup.flag" # find . $MDIRS -mnewer $FLAG -o ! $MDIRS -cnewer $FLAG \ | tar -cn -T- -f- | gzip -c > $DESTINATION.tar.gz However, as you pointed out, it will not record the fact that a file has been deleted since the last level-0 backup, so it's not a perfect incremental backup. (However, it's sufficient for me personally. Another solution would be to store the output from "find" along with the level-1 backup, so you can easily find out what files didn't exist anymore when you restore the backup.) You might also use the "-print0" flag on find(1) and the "--null" flag on tar(1) if there's the possibility that file names could contain whitespace ... I omitted some details for brevity. Anyhow, it's just a suggestion. It works perfectly fine for me, but it might not work for you. YMMV. > What is still do not understand is what time gtar uses for > --newer option. > > Man page says: > > --newer date Only store files with creation time newer than > date. > > This is simply not true. NOT creation time defenetly. Sure? Did you test it? > It is either modification time or inode change time. Which one? You can either simply test it by creating a few test files and making a test archive. Or look it up in the source code of gtar. I don't have gtar installed so I can't tell. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd Perl is worse than Python because people wanted it worse. -- Larry Wall