merged file to the legacy masters as if it were their own. I continued this process for each file or database.
Since each change was small and specific, I could test it incrementally. After literally hundreds of small changes, all the servers were 'singing from the same songbook.' At that point, it was easy to eliminate the legacy masters and let the new master be the authoritative master for all clients.
Warning
Any file that is automatically pushed to other servers should always have a comment at the top of the file warning other system administrators where the file came from and where to edit it.
Here's the warning I use: # THIS FILE IS MAINTAINED ON: server1.example.com # Edit it with this command: xed file.txt # If you edit this file on any other machine, # it will be overwritten. BE CAREFUL!
Since the previous note mentioned
Hard Things Done Once
When we find ourselves doing something very difficult, automating the task records what we've done. When we do it in the future, it will be easier. This is how we build up our little bag of tricks.
Encapsulating a Difficult Command
Sometimes it takes hours to work out exactly the right command required to do something. For example, there is a program that creates ISO images, the kind you burn onto CD-ROMs. Its manual page describes hundreds of options, but to make an image readable by Windows, Unix, and Mac systems, the command is simply: $ mkisofs -D -l -J -r -L -f -P '
Sure, you can do it from a GUI, but where's the fun (or ability to script) in that?
This command also lets you do things not found in most GUIs, such as the ability to specify a copyright note, author name, and so on.
This is a good example of something to work into a
Here's a shell script called
The 'date -u +%m%d' sets the volume name to the current date.
One of the things that held me back from writing good scripts was that I didn't know how to process command-line parameters. Here are instructions for copying all the command-line arguments into a script.
The $* in the
then the $* would be replaced by cdrom/.
Since $* works for multiple arguments, you can also do: $ makeimage1 cdrom/
Then the $* would be replaced by all three components. In the case of