Geeky Thought

The internet contains a vast number of interesting web sites. If you are like me you categorically bookmark your favorites. One site in particular that I visit often (and tend to get a chuckle out of their apparel) is ThinkGeek.com. They have quit a few gadgets and their t-shirts convey messages quite nicely. Although I can’t have them all (I do wish I had most of them) I did receive a Binary People and SQL query. Next on my wish list is WTF?, No, I will not fix your computer and Dead Hex People.

Any other favorites out there?



   

FTP Batch

File Transfer Protcol (FTP) is a quick way to transfer files between two computers. There are many FTP software programs, both the pay and free varieties, available. Windows® also includes a command line FTP program (ftp.exe).
In this GUI world many shutter at the thought of a command line application, however this one does have its advantages. For starters it is already included in the OS and doesn’t need to be installed. I attempt to not over complicate things and keep them clean and uncluttered. IMHO, the main advantage is the ability to process a text file that contains FTP commands. The parameter option to specify the text file to process is -s (to see the other parameter options at the command prompt type FTP -?).

This feature is advantageous because you can set up FTP batch files that perform various transfer actions without the need to click a number of buttons or type a number of commands. Login information can be included in the text file allowing access to those FTP locations that require user authentication. I have a number of batch files that I frequently use to transfer data. I have also set some up with the Windows® task scheduler for unattended processing.

A batch file could look something like this:

ftp -s:somefile.txt

In the somefile.txt file:
open 192.168.100.1
username
password

cd images
lcd images
send *.gif


The text file commands are passed a line at a time for processing. As displayed in the above example a username and password can also be passed, as those are typically the first two prompts after an FTP server connection is opened. The text file can contain any of the valid FTP commands (type ? at the ftp> prompt for a list of valid commands). I tend to be brief in my postings but hopefully you can see the value in the ability to do this. If you have any additional input I’d love to hear it.



   

Ode to Backup

Backing up your files is probably one of the most important things you could do. There is nothing worse than the feeling of loosing everything once your computer is on the fritz (I have received dozens of frantic phone calls asking how to, or if I can restore files). There are many commercial, shareware and freeware backup programs that are capable of accomplishing appropriate backups.

XCOPY has been included in the Microsoft® OS family since the DOS days. This little command prompt program copies file and folder information based upon the selection of a number of parameter options. This utility is lightweight and consists of a simple executable file. This is actually what I use for incremental backups of my personal system.

Open a command prompt and type xcopy /?. This displays a list of the xcopy.exe parameter options and their meaning. From the command prompt you can easily type in your xcopy command with the necessary parameters and you’ll be on your way. Personally I have a small batch file called backup.bat. This eliminates a lot of typing and the need to remember the options. This batch file is simple but extremely effective in giving me copies of the files I need. It consists of one line:


xcopy *.* c:\wutemp /S /C /I /M /F /R /H /K /Y /EXCLUDE:exclude.txt

My backup.bat file is located in the root of my profile directory, for this example we’ll say C:\Documents and Settings\BP. If you follow the parameters you’ll notice that I copy all the changed (archive bit set) files to C:\wutemp. This batch file will process the current folder and with the appropriate parameter set (/S) all subfolders as well. Once the backup batch is complete I them manually copy the files to DVD. If you are running a ‘full’ backup you would remove the /M parameter option.
I am fairly structured and organized when it comes to my files. I try to get everything that I need somewhere within the tree of my profile directory. Most applications these days store personal information in the Application Data of your profile directory or allow you to specify a ‘storage’ location. A lot of applications also store temporary or unimportant (unimportant in the sense of need to restore files in the event of a need to recover files) files in your profile directory as well. This is where the /EXCLUDE parameter comes into play. After all, it is really wasteful both time and space wise to back up all those temporary files.
My exclude.txt file looks something like this:

\DOCUME~1\BP\Templates
\DOCUME~1\BP\Start Menu
\DOCUME~1\BP\Recent
\DOCUME~1\BP\SENDTO
\DOCUME~1\BP\PrintHood
\DOCUME~1\BP\NetHood
\DOCUME~1\BP\Windows
\DOCUME~1\BP\Cookies
\DOCUME~1\BP\MY DOCUMENTS\MY MUSIC
\DOCUME~1\BP\LOCAL SETTINGS\TEMPORARY INTERNET FILES
\DOCUME~1\BP\LOCAL SETTINGS\TEMP
\DOCUME~1\BP\LOCAL SETTINGS\HISTORY

This is just an example on how I use XCOPY to back up my important files on my personal computer. In my opinion this is fast, lightweight and effective when it comes to storing those must have files. I hope this gives you some ideas on how you could possibly implement a simple backup solution.