Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Aug 2004 18:02:33 -0400
From:      Bill Moran <wmoran@potentialtech.com>
To:        dgw@liwest.at
Cc:        questions@freebsd.org
Subject:   Re: Accidentally truncated crontab
Message-ID:  <20040809180233.1e86b6e7.wmoran@potentialtech.com>
In-Reply-To: <200408092231.45340.dgw@liwest.at>
References:  <200408091928.20307.dgw@liwest.at> <20040809143801.08e33b00.wmoran@potentialtech.com> <200408092231.45340.dgw@liwest.at>

next in thread | previous in thread | raw e-mail | index | archive | help
Daniela <dgw@liwest.at> wrote:
> On Monday 09 August 2004 18:38, Bill Moran wrote:
> > Daniela <dgw@liwest.at> 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!
> 
> It was really not as complicated as I thought. After searching the web and 
> finding no undelete tools, but a tutorial on UFS layout, I pulled out the 
> binary editor and recovered the file myself. It was much easier than I 
> expected! Well, I had to make a copy of that file system, since it's root, so 
> I can't simply unmount it. But that was pretty much the only complication.
> I think that low-level stuff starts to grow on me! Maybe I should start 
> writing device drivers, kernel modules and so on.

Well, I'm glad you were able to figure it out.  Yes, you should definately
start writing device drivers and kernel modules and the like ... the team
can never have too many enthusiastic hackers!

> > 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.
> 
> No, the file was heavily customized.

Ahh ...

> > 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!
> 
> Yes, you're right, I was an idiot.

I said foolish, I didn't call you an idiot ... there's a big difference.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040809180233.1e86b6e7.wmoran>