
                                System Maintenance Package

                                      Version 0.5.2

                                       29-Apr-2001

                                       By Dale Weber
                                   <netman@dynaplex.net>

		***********************************************************************************

PURPOSE:          To simplify common maintenance tasks, such as updating ports and source trees,
		cleaning source trees and ports, building software (including OS and Kernel),
		and making backup archives of important files.

		  To allow batch execution (via cron) of any selected tasks for periodic and special
		maintenance tasks.

		  To allow full automation and repetition, with complete configurability, of system
		builds, including building the OS, Kernel, and sofware from the ports tree. 

SYSTEM:         FreeBSD 4.x

LANGUAGE:       Python 2,0 (*may* or may *not* work with Python 1.5.2) with some csh.

REQUIREMENTS:   Python 2.0, cvsup 16.1

		***********************************************************************************

		  You may think this is a pretty tall order, but I already have most of this working,
		and am well on the way to making the rest work. ;)

		  I wanted to accomplish three things:

			1) Make tasks I do frequently easier to do.

			2) Be able to run batch jobs of any combination of tasks.

			3) Be able to fully automate a system build from scratch.

		So far, I've accomplished #1 and #2 and am working on #3.


		##########################################################################################
		##                                                                                      ##
		##                 I M P O R T A N T   I N F O R M A T I O N   ! ! !                    ##
		##                                                                                      ##
		##########################################################################################

		  NOTE: You must set the KERNCONF environment variable in order to use the "build kernel"
		function.  To do this for csh, add the line "setenv KERNCONF <your kernel config file>" in
		/etc/csh.cshrc or ~/.cshrc.

		  For bash, set KERNCONF by adding "export KERNCONF=<your kernel config file>" to either
		/etc/profile, /etc/bashrc, or ~/.bashrc files.

		  You may have to edit the supfiles in /usr/local/etc/maint/supfiles to user servers that
		work best for you, and to make sure you get the right version of the source tree for YOUR
		system.  The supfile sample files are setup for FreeBSD 4.x now.  If you are running 4.x,
		then you just need to rename the supfiles from *.sample to having no extension. For example,
		do "mv ports.sample ports", etc.

		  You *may* also have to edit some paths in /usr/local/bin/maint.py to fit *your* system.
		All the paths are at the very top of the script, to make them easy to find.

		  For the batch command files (*.conf.sample) in /usr/local/etc/maint, add the sequences
		of commands you want to execute at the given time.  The special.conf.sample file is
		handled slightly differently, in that it is setup specifically to be run interactively
		and show ALL output from ALL functions so command files can be tested and debugged. To
		run the special command file, edit it, and do "maint special" anytime.

		##########################################################################################
		##########################################################################################

		  The maint package is written in Python, and is very modulare and easily extendable to
		do whatever tasks you may want to have done that I haven't already accounted for.  The
		key here is *ease of use* rather than doing something quick and dirty.

		  I always welcome suggestions for improvement, as long as you keep in mind that this IS
		a work in progress and is stil a ways from v1.0.0 release.  You may send suggestions and/or
		bug reports to software@dynaplex.net and I will respond as soon as I can.

		  Now, on to the rest of the doctumentation.. ;)

		  I've built maint in a very modular fashion,
		with each major function handled by a separate script.  The backup, build, clean, restore,
		and update functions are all separate scripts called buy maint (the mainline script). The
		main maint script also handles the batch file opertions, by reading the command file and
		executing the commands in sequence.

		  There are also still three csh scripts called by the build script, but these will go away
		very soon.

		-------------------------------------------------------------------------------------------

		  Here is a listing of current functions handled buy the maint package:

			backup

				all		Handled all of the backups following:

				downloads	Backs up your download directory

				music		Backs up your music files

				ports		Backs up the ports tree (/usr/ports)

				source		Backs up the source tree (/usr/src)

				system		Backs up selected system files (more on this later)

			build

				all		Builds EVERYTHING below

				freebsd		Builds the OS by doing a "make world"

				kermel		Builds the kernel - does not use "make buildkernel"

				readmes		Builds the ports tree README.html files

				portsdeps	Builds the ports dependency database used by "build system"

				system		Automatically builds your entire OS, Kernel, and software
						you select from the ports tree - user configurable.

			clean

				all		Cleans both ports and source trees

				ports		Cleans the ports tree (/usr/ports)

				source		Cleans the source tree (/usr/src)

			restore - these are the inverse of the backup functions

				all

				downloads

				music

				ports

				source

				system

			update

				ports		Updates the ports tree (/usr/ports) using cvsup

				source		Updates the system source tree using cvsup

                -------------------------------------------------------------------------------------------

		The BATCH facility:

		  To use the batch facility, edit the appropriate configuration file (daily.conf,
		weekly.conf, monthly.conf, or yearly.conf) and put your selected commands in them.
		The sample files (daily.conf.sample and weekly.conf.sample will serve as examples.

		  For monthly or yearly batches, you will need to create monthly.conf and/or
		yearly.conf in usr/local/etc/maint in the same format as the daily.conf and
		weekly.conf files.

		  The special.conf file is there to allow testing of command file sequences if there are
		problems, so you can see all the output from each function as it runs.

		  To enable the batch facility, move the appropriate scripts from the usr/local/etc/scripts
		directory to /etc AFTER you have edited the daily.conf, weekly.conf, monthly.conf, and/or
		yearly.conf files.

		--------------------------------------------------------------------------------------------

		That's all there is for now!
