Archive

Archive for the ‘Batch Scripting’ Category

Batch Commands That Gets The Jobs Done

April 25, 2012 Leave a comment

That task is about file transferring, we need to transfer the files that the Agents recorded on their calls throughout the day. Since each agents can create almost 50+ calls. Each folder can go up to 500 MB of size, say there are 60+ agents that’s 60 folders of 500MB size. Thats a long wait for a transfer specially the transfer method is networked,  meaning from WindowsOS to CentOS using Samba Drive, and did I mention the OS difference? Yes,  Samba is a interoperability software that aids the Windows in transferring files to another OS, in short it acts as a middleware between Operating Systems, not only that it also supports printing and filesharing, for the CentOS it is a variant of Linux Operating system and it is a free OS. Why CentOS? Ask the company XD.

Anyways I’ve created a simple code in Batch that will automate the file transferring because the usual method of transferring the file is through copy paste and wait until the loading is done. You probably think that why not copy paste them all?! Well you can but then it will take you forever the finish the files at least for my experience because the computer that holds the data is weak and outdated. It has to be one at a time to keep the system stable at the same time the computer wont hang up.

So what I realized that doing this over and over again is too much hassle especially we are also busy doing things in the field like Network Cabling, we have to be in the field early morning to finish the cables that we are supposed to finish.

I’ve made a simple file transfer tool from batch commands,  it doesn’t speed up the transfer rather than it automatize the routine of copy all files in a folder and transfer it to the other folder and do it again for 60 times.

The crucial part of the program is the check  size of the folder  because there are no built in commands in command.com in identifying the size of the folder rather it only supports the size of the file so I had to search of a solution and found that algorithm in the internet. Thanks internet 😀

If you guys ever want to script batch commands,  I just started reading the wiki and few samples and then after 3 hours I’ve made this script. It took me less than a day to finish the script. Though it looked like it is working but there are things that needs to implement in the script, I need to implement the log system wherein it records the activity that it executes like the date, time and also the size of the folder to compare their folders for authenticity of the files.

Read this articles and you will be scripting this awesome commands in no time:
Aumha
Wikipedia

Advertisements
%d bloggers like this: