From owner-freebsd-questions@FreeBSD.ORG Mon Aug 9 18:38:03 2004 Return-Path: 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 7430A16A4CE for ; Mon, 9 Aug 2004 18:38:03 +0000 (GMT) Received: from internet.potentialtech.com (h-66-167-251-6.phlapafg.covad.net [66.167.251.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4676E43D49 for ; Mon, 9 Aug 2004 18:38:03 +0000 (GMT) (envelope-from wmoran@potentialtech.com) Received: from working.potentialtech.com (pa-plum-cmts1e-68-68-113-64.pittpa.adelphia.net [68.68.113.64]) by internet.potentialtech.com (Postfix) with ESMTP id 697D669A71; Mon, 9 Aug 2004 14:38:02 -0400 (EDT) Date: Mon, 9 Aug 2004 14:38:01 -0400 From: Bill Moran To: dgw@liwest.at Message-Id: <20040809143801.08e33b00.wmoran@potentialtech.com> In-Reply-To: <200408091928.20307.dgw@liwest.at> References: <200408091928.20307.dgw@liwest.at> Organization: Potential Technologies X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: questions@freebsd.org Subject: Re: Accidentally truncated crontab X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2004 18:38:03 -0000 Daniela wrote: > Hi all! > > I just emptied the system crontab, and don't know how I can recover it. > I know that the contents are still somewhere on the drive, as I didn't write > anything on that partition. > The size of the file must be stored somewhere in the inode, or maybe in the > directory, so I could just load the raw partition into my hexeditor and > change that field to the original length. But I thought I'd better not touch > it without consulting the experts first, because I don't have much experience > with file systems. > In the ports I couldn't find an undelete utility, and the -w option to rm > doesn't work here. > > Please help me, or at least tell me that there's nothing else I can do, so I > can use the method mentioned above. Well ... there are some undelete utilities out there (I'm surprised there are none in the ports) and I've seen a number of tutorials on how to recover deleted files from UFS filesytems ... but I think you're _seriously_ overcomplicating things! If you haven't customized the crontab, and you have sources installed, then "cd /usr/src; mergemaster" will give you an opportunity to re-install the default system crontab. You could also download it directly from CVS. If you did customize it and are foolish enough not to have backups, then do some google searches on "undeleting from UFS" or something like that. I've seen a few articles on how to do it in the past. And start making backups. Putting your /etc directory under revision control is a decent idea! -- Bill Moran Potential Technologies http://www.potentialtech.com