Dwarfsoft [GPA]

AutoStore Script

by on Mar.30, 2008, under Novell, Scripting, Training, Work


Print This Post Print This Post

It has been a while since the last update, and that is due to a number of factors:

  • Firstly being Family Reasons, I have been given the ultimatum that I spend far too much time on the Computer and not enough with my Family, which I am attempting to rectify.
  • Secondly being Workload, as I have been putting in a fair bit of effort at work, and have been exhausted when returning home.
  • Study has required a fair bit of time as well, as I am attempting to finish off some of those exams I have neglected for far too long
  • Job Applications has taken up time outside of work, as I am busy attempting to better my circumstances due to some positions opening up at my current employer. I have had to cobble together an Application, and am now attempting to get things together for potential interviews.
  • Projects and ideas have been coming more frequently of late, as it starts to hit that time of the year (Autumn for me) where I get inspiration and motivation to complete things, so I have been documenting some of these ideas and inspirations and will be endeavoring to get some project work done soon.

So at work I have been involved in a few Scripting Enterprises. The most recent being the AutoStore script. This script effectively checks the age of a Stored Image on the computer, and makes a decision on whether to Store a new Image to replace it. The Image in question is a PowerQuest (yeah, I know that Symantec bought them, and its old tech, but for some reason we are still using it. I hear rumours of Ghost being on the Horizon though) .

This script is nothing special, it calls diskpart to mount the hidden volume, then checks some file timestamps,  makes a decision on whether the interval between the modified timestamp and the current date is too much (based on a Command Line Parameter), and initiates a Store using a Virtual Floppy Disk.

The reason why this is such an interesting aspect of work is that it has been three years coming. It took three years before somebody noticed that this could be achieved to reduce our overal response time to solving issues. Not only that, but it took all of 5 minutes to get an initial prototype working using just simple cmd.exe commands. This was a political nightmare for the person who neglected doing this task, and a political goldmine for me… Considering we are both applying for the same Position mentioned above.

So, how do you implement something like this on a Novell Directory System? Simple:

  1. Create your script that does all the logic. I built it into one script, but it could quite easily have been separated out into three seperate ones. The logic it uses is based on Command Line Parameters to choose what part to do.
  2. Create a NAL that Distributes the Script, this was distributed to the same directory that had the Manual Store Script and Virtual Floppy Disk Images.
  3. Create a Workstation Policy, and then create a Scheduled event to Run the Script on Login to extract the modified timestamp, and image age (in days) from the image file, and insert it into the Registry (this is what the script does).
  4. Create a Scheduled event to run the Script once every Day to update the modified timestamp, and image age (in days) from the image file, and update the registry (this could quite easily just update the age without rechecking the file)
  5. Create a Scheduled event to run the Script on Logoff, where the Image Age is checked against the Interval given on the command-line. If the age is greater than the Interval, then start a new Store.

An interesting thing to note in this scripted procedure is that if somebody initiates a shutdown, and a new Store is initiated, the computer actually shuts down and turns off. The next time the computer is turned on, a Store is initiated before Windows Boots, thereby only impacting on the startup time, not the power consumption over the long weekend (for example).

I have also built into the tool a message box that asks a user to reboot if the PC is left turned on for more than some interval (specified on the command line again). This is intended to initiate a reboot of the PC for workstations that are never rebooted (which causes more issues, not just the lack of a current Image).

Cheers, Chris.


Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!