Eyes bigger than your stomach

I was setting-up a set of scripts today to do backups of a client's web content. I finished writing the script, ran a few test runs (where data didn't actually replicate), and then kicked it off "for real". The script ran for about 15 minutes or so and I went off to check email, clear-out the 15 IM windows that have poped up in the past hour, and get a new Mt. Dew. While I was walking back up the stairs, my cell phone starts to vibrate. Ugggg! A file system was full on the backup server.

The customer had signed-up for a 10GB backup plan, and had recently requested to have another server added to the backups. I went back to find out how much data was on the source-server that the customer was wanting to be backed up:

$ sudo du -sh * .

 

41M site1.com

 

110M site2.com

 

4.0K site3.com

 

9.6G site4.com

 

9.8G .

You can see the individual breakdown of the directories and the total of the current working directory by using the "du" command by passing a splat (*) and a dot (.) as the args. The "-h" option gives a nice human readable form on the summarized calculation (determed by the -s option).

In the end, I emailed the customer telling them we needed to upgrade them to a larger backup plan, we allocated more space to their file system, and everything was okay. The moral of the story is listen to what your mom always used to say and never let your eyes get bigger than your stomach, and check to make sure you've got enough disk space for the task at hand.