Monday, December 29, 2008

Create Optimized DVD/CD Images of Folder for Backup

The Problem:
I have music, videos, pictures, and files that all need backups. I have them organized how I want, but they don't always fit perfectly on to a DVD. I want a simple program that I point to a directory and it will create optimized image files for burning to a dvd. I would also like to do a few quick 'dry runs' to be sure that I like which files go in each image and that I don't have an image that is only 10% full!

The Solution:
Well, if you can't find one... make one! I decided to write a script that linked up with PowerISO's commandline tool (piso) to create images of files. You will need several Gigs of space to store the images... This is nice because you don't have to go through all your files and figure out how to divide them among images... You just do a few dry runs and then when you are happy, let it go all night!

The Script
This script uses the command line utility of PowerISO to create disc images of a folder and tries to maximize the disc usage while still preserving the file structure of the provided folder. You will need to add the PowerISO install path to your path environment variable
file_dvd_backup.py
Further Explanation:
OK, so as an example, I want to backup all of my pictures. I keep them (as seen in a previous post) in the structure of YYYY\MM month and when I burn a backup image of all of my pictures. I would prefer to keep as many pictures of the same year together as possible, however, if there is a large file (say a video clip) in one folder that doesn't fit on a dvd that is only 50% full, I would prefer it to be on a new dvd image, and then continue to fill first dvd, and then fill the new dvd image. Confusing I know, it creates dvd's that are usually about 99% full, even with a few large files mixed in.

I also hate searching for which dvd has what folder. The script creates a list of directories contained on each disc and add that file to each image. It makes it very easy for figuring out which disc has what pictures. The script could easily be altered to contain a list of all folders AND files, but I thought that was overkill.

0 comments:

Post a Comment