Posts

Showing posts from January, 2006

Automated CD Burning using AutoMount

One recent project for my employer was to create a headless (pc with no keyboard, mouse, or monitor) CD burner that automagically detects an inserted flash card, renames the files, and burns them to a CD along with a Flash Projector application that plays the images on PC's or Mac's. My solution was to use the AutoFS automounter daemon, and shell scripts. Much of the scripting ideas borrowed heavily from the BashBurn project. The hardware used was commodity workstations, and a 9-in-one flashcard reader configured as a SCSI device. See the following articles for interesting info: http://www.grack.com/news/2003/Atech9-in-1CardReader.html http://www.cs.sfu.ca/~ggbaker/personal/cf-linux The file test.sh is run by cron every 20 seconds, piping the command through sleep: * * * * * root sleep 0; /usr/local/copydisk/test.sh && sleep 20; /usr/local/copydisk/test.sh && sleep 40; /usr/local/copydisk/test.sh Test.sh contents: #!/bin/bash if [ -f /usr/local/copydisk/

Windows VBS Automated Maintenance Scripts

I had a need to automate a number of tasks for remote administration, and used Visual Basic Scripting and Windows Scripting Host Objects, since I am fairly comfortable with VB/VBA. This is an automated defragmentation script that uses dirms.exe, a defragmentation utility found here . Option Explicit Dim FSO, Drive, oShell, WshShell, BtnCode, rtn, hd, stComp Set WshShell = WScript.CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set oShell = WScript.CreateObject ("WScript.shell") '''' ''''''''''''''''''' DIRMS.EXE USAGE ' dirms c -q : Do free space evaluation, defragment, and quickly move files to the front of the drive ' dirms c DEFRAG -q : Defragment files only ' dirms c CoMpAcT -q : C ompact only ' dirms c COMFRAG -q : Perform partial compaction (quickly) on all fragmented files ' dirms c COMFRAG c:\filena