For the web development that I’m doing at work, I use Zend Studio 5.1 Professional. When I work from home I use the built in FTP client to access my files. No problems there.

Well, usually.

I knew something was wrong when I went to the web to view the files I had worked on previously and noticed that the page would only half-load. I ssh‘d into the server and ran a df. It showed me 100% usage of the hard disk.

As it turns out, I had broken my daily backup cron script. Every day it was backing up the backups directory. And consequently, it was doubling in size each day. The natural progression here is that it fills up the entire hard drive of the machine. Which, as it turns out, is exactly what happened and this, of course, is a major problem.

So I deleted the huge backups such that I would have some free space on the hard drive. I then went and looked at the two files I was working on. One was just the next sub-project I was working on and was very early on in development. The other was the index page for a large application I’ve been working on. Things were still kind of wonky it seemed, so I decided to restart the server – this isn’t a production server yet, so it wasn’t a big deal.

And then there were problems.

After the restart I went back to the web and looked at the two pages again. Hmm, I had the same problem: half loading pages. What was going on? So I went back into Zend Studio and brought up the two files. What did I see: a zero-byte file and another file that looked as though it was cut right in half. The second half of the file was simply gone. Grrrreat. For whatever reason, when the hard drive filled up, it must have erased those two files. How that happened I have no idea.

Ok, no big deal, I’ll just grab the two files from yesterday’s backup.

Wait a minute; I just deleted those backup files because they were ginormous. Awesome! Now, the most recent backup I have is a week old.

The moral of this short narrative is a time-tested truth: backup often and make sure that the backups work.

Thankfully it only took me 2 HOURS to get everything back to normal. Huzzah.

Drop Some Knowledge On Us…