Wednesday, September 10, 2008

Command line VS. GUI (Example)

Now that I have a post titled "Command Line vs. GUI", I feel the need to actually have a comparison. In this case, I’m going to talk about backups. I remember doing restores from GUI systems and the options I had to restore files was a check box next to the file or directory I would like to have restored. This is nice for one or two files, or a whole directory of files. I have run into cases though where a customer requires about 400 files restored. These files tend to have the date in the name to make it easy, but the extensions don’t always match up. In one case you might have two files like:
Foo.bar.200809101300.txt
Foo.bar.200809101300.bin

You can see that if someone needs to have “the holiday weekend” restored, that’s three days of files.

When confronted with a GUI, I have to checkbox each one of these files. Not only that, but I have to scan through all the files in the directory and try to pluck out the ones that need to be restored.

Here is the command line equivalent that I would use
dsmc q backup -inact /some/directory/active/foo.bar.20080910"*" |grep DEFAULT | awk '{print $7}' > /some/directory/archive/filelist.txt

dsmc rest -ina -filelist=/some/directory/archive/filelist.txt /some/directory/archive

The first command generates the list of files, and the second command restores all the files found in the list.

That's why the windows guys get teased with "click, click, click, click".

0 comments: