Networking

Maintaining a K-12 computer network on a tight budget

By making use of scripting, command line tools, and online resources described in this article, it is possible to build powerful automated management tools.

By William T. Evans

Maintaining a K-12 Computer Network is a challenging and time consuming task. Staffing shortages mean less time to be proactive, to review log files, and improve procedures. Budget constraints and administrative restrictions make it difficult to purchase network management software. However, there are a number of ways that a network administrator for a K-12 network can improve methods of maintenance with little or no cost.

Disk defragmentation with a script

Performing disk defragmentation is a very important part of maintaining network servers. It improves performance and capacity of computer disk systems, and it improves system performance as a whole. There are a number of software products, and enterprise level ones, that handle and perform disk defragmentation automatically. Although they offer certain benefits; they are not completely necessary. This process can be automated with a simple script.

Create a simple batch file with the following commands (add more commands for additional drive letters):

DefragC.bat
REM Create Time Stamp
date /t > defragC.log
time /t >> defragC.log
REM Defragment C drive and write to log file
defrag.exe C: -v >> defragC.log
time /t >> defragC.log

This batch file can be set to run automatically by using the Task Scheduler built into Microsoft Windows. For network servers, it's best to defragment hard disks once a week.

**NOTE: Running defrag on file servers is critical. If left alone the disks can become so fragmented that a defrag can NEVER be run. At that point the disk must be reformatted.

Time synchronization with a script

It's critical to operation that all network devices (servers, workstations, switches, routers, etc.) maintain the correct time/clock setting. Although Windows systems automatically maintain clock synchronization—sometimes it's inconsistent. As with there are with disk defragmentation, there are a number of inexpensive software products to improve this process. You can also use this simple script:

TimeSync.bat
ECHO Using PSEXEC synchronize System Time on all DC Servers... > TIMEsync.log
ECHO. >> TIMEsync.log
date /t >> TIMEsync.log
time /t >> TIMEsync.log
psexec -c -s \\server1 TimeSync_DC1.bat >> TIMEsync.log
psexec -c -s \\server2 TimeSync_DC1.bat >> TIMEsync.log
psexec -c -s \\server3 TimeSync_DC1.bat >> TIMEsync.log
date /t >> TIMEsync.log
time /t >> TIMEsync.log
ECHO. >> TIMEsync.log
ECHO Synchronizing process complete. >> TIMEsync.log
 
TimeSync_DC1.bat
net time \\dc1 /set /y

These batch files perform a time synchronization for three servers. Using psexec.exe, the script can be run from one location. The script assumes the following:

  • There are three servers named SERVER1, SERVER2, SERVER3
  • The "primary" domain controller is named DC1

This process can also be automated by using Windows Task Scheduler. It is best to run this process once per day or once per week depending on the network layout.

**NOTE: psexec.exe is part of the PSTOOLS suite found at http://www.sysinternals.com/Utilities/PsTools.html

Creating a process for off-site data backup

System and data backup is a critical part of running and maintaining any computer network. Backup and disaster recovery has become even more important in K-12 environments with recent legal developments. Most, if not all, K-12 systems have a regular (daily or weekly) backup routine. The problem with many backup systems is that they're on-site. Performing an off-site backup is an excellent secondary backup routine to have in place. It provides redundancy in backup and increases disaster recovery capabilities. Although there are a number of enterprise level products that handle off-site data backup, you can use the following script to create a simple off-site backup process. This does require an off-site low-end server or workstation running at all times (and preferably on battery backup).

CBackup.bat
REM Call Core Backup BAT File
call cbackup1.bat > CBackup1.log
REM Call Secondary Backup BAT File
call cbackup2.bat > CBackup2.log
 
CBackup1.bat
REM Clean-up and Prep Process
del /q E:\Backups\ *.*
REM Pull Data Files From All Core/Critical Locations
REM Backup SERVER1 Data via File Pull
xcopy /y \\server1\c$\data.zip E:\Backups\server1.zip
REM Backup SERVER2 Data via File Pull
xcopy /y \\server2\c$\data.zip E:\Backups\server2.zip
REM Backup SERVER3 Data via File Pull
xcopy /y \\server3\c$\data.zip E:\Backups\server3.zip
 
CBackup2.bat
REM Clean-up and Pre-process Stuff
del /q \\server-offsite\c$\backups\*.*
REM Push Data Files From All Core/Critical Locations To Off-Site Server
REM SVS Data Push
xcopy /y E:\Backups\server1.zip \\server-offsite\e$\backups
xcopy /y E:\Backups\server2.zip \\server-offsite\e$\backups
xcopy /y E:\Backups\server3.zip \\server-offsite\e$\backups
 

The above process gathers all critical data to a local (in data center) server for processing and local archiving—then it pushes those backup files to the off site server. If the backup data is not already in a compressed format (as shown), You can use a simple command line compression utility. Additionally, the script assumes the following:

  • There are three servers—SERVER1, SERVER2, and SERVER 3—that have critical data to be backed up
  • The LOCAL backup server has a folder E:\Backups
  • The REMOTE backup server has a folder E:\Backups

**NOTE: You may enhance the use of this batch script (and others) by using a command line e-mail tool. The tool can then e-mail copies of log files (as shown here) or specific messages as to how the process completed. One excellent command line email tool is blat.exe (http://www.blat.net/).

Conclusion

Finding time for routine server maintenance tasks is difficult—and sometimes impossible. By making use of scripting, command line tools, and online resources it is possible to build powerful automated management tools. The above examples are just a few of the many possible ways to cut software costs and fit maintenance services into a K-12 technology budget.


Editor's Picks

Free Newsletters, In your Inbox