I'm learning Linux, and part of that, for me, includes bash scripting. If you're not familiar, it's basically executing a number of Terminal (command prompt) commands in sequence. There's also some basic flow control that lets you write simple programs. Anyway, while learning it, I decided to try writing some marginally useful things as exercises. One of these was a simple backup script. It would create a folder on my external hard drive based on the date, and copy the contents of my Pictures, Music, etc... folders to identically named directories inside the dated folder. Well, that worked, but the total size of the directory created is about 67 GB. I had an idea: What if I compress the folder? Like with 7zip?
And this is where things start to fall apart.
I tried using 7zip on the directory in question, but it didn't like working on an external hdd (it spat back a "no room on disk" error- there's 700 GB of free space left) So, I did this: I had the script first copy the files over to my Windows hard drive, then 7Zip it, then move the .7z file onto the external hard drive, then delete all the backup files from the WinBox, as I call it.
Well, surprisingly, the problem wasn't with the code that I wrote; it was written perfectly. However... there were other issues. The original script takes about 20 minutes to copy all my shit onto the external hdd. This script took well over five hours. 99% of that time was spent running 7zip. In fact, it took so long that my external hard drive unmounted, or shut down to conserve power, whatever - so when the script tried to locate the final backup directory, it utterly failed to do so, and I was left with a massive .7z on my WinBox.
To make matters even funnier, the final result of my ultra-compression? The .7z was only 6 GB smaller than just moving the folders as they were. 6 GB may seem like a lot, but the difference between 61 and 67 isn't much compared to the fact that I was unable to use my computer for hours (CPU was at 99% usage).
I know, I know, there are much better backup solutions that just writing some bash script. I just wanted to test my own writing skills. THAT, I guess, was a success, but the degree to which my little experiment failed was hilarious.