From owner-freebsd-questions@FreeBSD.ORG Thu Jan 12 23:25:12 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 430CF16A41F for ; Thu, 12 Jan 2006 23:25:12 +0000 (GMT) (envelope-from h.nieser@xs4all.nl) Received: from smtp-vbr9.xs4all.nl (smtp-vbr9.xs4all.nl [194.109.24.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFD2243D46 for ; Thu, 12 Jan 2006 23:25:11 +0000 (GMT) (envelope-from h.nieser@xs4all.nl) Received: from [192.168.1.10] (nieser.net [194.109.160.131]) by smtp-vbr9.xs4all.nl (8.13.3/8.13.3) with ESMTP id k0CNPADn023311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Jan 2006 00:25:10 +0100 (CET) (envelope-from h.nieser@xs4all.nl) Message-ID: <43C6E55A.8020500@xs4all.nl> Date: Fri, 13 Jan 2006 00:25:14 +0100 From: Hans Nieser User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner Subject: 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: Thu, 12 Jan 2006 23:25:12 -0000 Hi list, For a while I have been doing remote backups from my little server at home (which hosts some personal websites and also serves as my testing webserver) by tarring everything I wanted to be backed up and piping it to another machine on my network with nc(1), for example: On the recieving machine: nc -l 10000 > backup-`date +%Y-%m-%d`.tar.gz On my server: tar -c -z --exclude /mnt* -f - / | nc -w 5 -o aphax 10000 (Some excludes for tar(1) are left out for simplicity's sake) 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. Do I really have to use MySQL's tools to do a proper SQL dump or stop MySQL (and any other services that may write to files included in my backup) before doing a backup? Do any of the more involved remote-backup solutions have ways of working around this? Or is it simply not possible to write to a file while it is being read?