From owner-freebsd-questions@FreeBSD.ORG Sun Jan 15 03:28:16 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7601816A41F for ; Sun, 15 Jan 2006 03:28:16 +0000 (GMT) (envelope-from hans@nieser.net) Received: from smtp-vbr14.xs4all.nl (smtp-vbr14.xs4all.nl [194.109.24.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCF5943D45 for ; Sun, 15 Jan 2006 03:28:15 +0000 (GMT) (envelope-from hans@nieser.net) Received: from [192.168.1.10] (nieser.net [194.109.160.131]) by smtp-vbr14.xs4all.nl (8.13.3/8.13.3) with ESMTP id k0F3SChW015215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Jan 2006 04:28:12 +0100 (CET) (envelope-from hans@nieser.net) Message-ID: <43C9C14F.3050105@nieser.net> Date: Sun, 15 Jan 2006 04:28:15 +0100 From: Hans Nieser User-Agent: Mail/News 1.5 (X11/20060113) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <43C6E55A.8020500@xs4all.nl> <20060113145003.GJ2451@ayvali.org> In-Reply-To: <20060113145003.GJ2451@ayvali.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner Cc: siegfried.pietralla@eds.com Subject: Re: mysql backups (was Re: Remote backups, reading from and writing to the same file) 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: Sun, 15 Jan 2006 03:28:16 -0000 N.J. Thomas wrote: > * Hans Nieser [2006-01-13 00:25:14 +0100]: >> Among the things being backed up are my mysql database tables. This >> made me wonder wether the backup could possibly get borked when mysql >> writes to any of the mysql tables while tar is reading from them. > > Yes. While MySQL is writing to the the database, it will put the files > on the disk in an inconsistent state. If you happen to copy those files > while they are in that state, MySQL will see a corrupted database. > Thanks for the replies all. I think for the short term I will simply lock/shutdown my MySQL server (it is a home-server after all), in the long term I think I will look into snapshotting. I've also been thinking about just doing an SQL dump with mysqldump right before the backup, that will still copy along the tables which may be in an inconsistent state, but also the sql dump.