From owner-freebsd-questions@FreeBSD.ORG Fri May 2 15:58:11 2008 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 7F7EC1065675 for ; Fri, 2 May 2008 15:58:11 +0000 (UTC) (envelope-from z.szalbot@lc-words.com) Received: from relay.lc-words.com (relay.lc-words.com [62.121.130.110]) by mx1.freebsd.org (Postfix) with ESMTP id C8D0C8FC1E for ; Fri, 2 May 2008 15:58:10 +0000 (UTC) (envelope-from z.szalbot@lc-words.com) Received: from localhost (localhost [127.0.0.1]) by relay.lc-words.com (Postfix) with ESMTP id 0832AC9458; Fri, 2 May 2008 17:58:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lc-words.com; s=mainlcwords.key.pem; t=1209743889; bh=sUfMbUliIkEC0AVS+Vh9G75KW1O AHVCy4dYj8KUtHSo=; h=Message-ID:Date:From:Reply-To:MIME-Version:To: CC:Subject:References:In-Reply-To:Content-Type; b=feQIjZY1SJ0LFVj4 gjOHG6BUNbBsCzppqQvo92RsVonRuxWoJ4YrRAeEGdexMk3Se12TtT6XCWve2p1FCcT 5NMBn2RMhEe17jxvsYS575iv9Td9XsO9C7WxSn9rUH50N392m4WzpvkgsQU6UloWXvu fIHRkgWECZreTBvhmNNco= Received: from relay.lc-words.com ([127.0.0.1]) by localhost (relay.lc-words.com [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 37437-09; Fri, 2 May 2008 17:58:08 +0200 (CEST) Received: from [127.0.0.1] (87-205-237-6.adsl.inetia.pl [87.205.237.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: info@lc-words.com) by relay.lc-words.com (Postfix) with ESMTPSA id 510F0C9428; Fri, 2 May 2008 17:58:08 +0200 (CEST) Message-ID: <481B3A0E.6060300@lc-words.com> Date: Fri, 02 May 2008 17:58:06 +0200 From: Zbigniew Szalbot User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Chris Pratt References: <481B08B2.7070702@lc-words.com> <4C629ECE-9203-4A3B-94FA-8BACEA07EE70@hughes.net> In-Reply-To: <4C629ECE-9203-4A3B-94FA-8BACEA07EE70@hughes.net> Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms040604040504080305050305" X-Virus-Scanned: Maia Mailguard Cc: freebsd-questions@freebsd.org Subject: Re: handling mysql binlog data X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: z.szalbot@lc-words.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2008 15:58:11 -0000 This is a cryptographically signed message in MIME format. --------------ms040604040504080305050305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, Chris Pratt pisze: > On May 2, 2008, at 5:27 AM, Zbigniew Szalbot wrote: > >> Hello, >> >> Following a recent thread I would like to ask if it is safe to >> remove old binlog data. From the below I understand that the >> current binlog is mysql-bin.000007 and the previous ones (from >> 000001-000006) are not written to any more. I just need >> confirmation before I take any action. By asking whether it is >> safe, I only mean if deleting them will not affect mysql operation. >> I do backups of mysql data anyway. >> >> -rw-rw---- 1 mysql mysql 61956466 Apr 16 08:44 mysql-bin.000001 >> -rw-rw---- 1 mysql mysql 697756219 Apr 17 14:26 mysql-bin.000002 >> -rw-rw---- 1 mysql mysql 1056 Apr 17 14:29 mysql-bin.000003 >> -rw-rw---- 1 mysql mysql 1073745860 Apr 24 05:49 mysql-bin.000004 >> -rw-rw---- 1 mysql mysql 620489997 Apr 27 10:48 mysql-bin.000005 >> -rw-rw---- 1 mysql mysql 229357379 Apr 28 15:55 mysql-bin.000006 >> -rw-rw---- 1 mysql mysql 869964294 May 2 14:15 mysql-bin.000007 >> >> Do I understand correctly that removing mysql-bin.000007 would >> result in mysql not writing any data to mysql-bin file until the >> server gets restarted? >> > > I recently removed all logs prior to the one shown as current > without any problems. I would not think you would want to > remove the one currently in use or problems would result. > > The procedure for this is here: > http://dev.mysql.com/doc/refman/5.1/en/purge-master-logs.html > for 5.1 and here: > http://dev.mysql.com/doc/refman/5.0/en/purge-master-logs.html > for 5.0 Thanks a lot! It did help me get rid of a few files in a safe way. I only wonder now how to set up a cron job to do it on a permanent basis? 1/ I would probably be better off setting this mysql query (URGE {MASTER | BINARY} LOGS BEFORE 'date') in a separate file an run it from cron? 2/ Even if I do that, I would still have to change the 'date' value each month... hmm... as non-programmer I will probably do best to simply enter a task in a calendar to run this manually... each month :) Thank you anyway - this was very helpful and I instantly saved a lot of space on a shrinking /var partition! -- Zbigniew Szalbot www.lc-words.com --------------ms040604040504080305050305 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIIDzCC AmIwggHLoAMCAQICEHu/rJNLTC9H4eJZYOf+/Z0wDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UE BhMCWkExJTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMT I1RoYXd0ZSBQZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA4MDQyNjE1MjAzOVoX DTA5MDQyNjE1MjAzOVowSDEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjElMCMG CSqGSIb3DQEJARYWei5zemFsYm90QGxjLXdvcmRzLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOB jQAwgYkCgYEAwBXt/3Jlh3DcJScjw091dfTrKTsz9LxRe5EC6YtlCOaRtnkZIPVF0BfpVTy1 rRE+8LWJLq9fEgGAJPOqqgy9gHV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