Page 1 of 1

Creating a log of all actions, installs, etc

Posted: Thu Aug 07, 2008 3:37 am
by alex.barylski
I know there is a log file or cache of commands executed at the CLI -- although for the life of me I cannot remember the name...

I am going to be re-installing my development server here with the latest stable release of Debian. I am also going to be applying some additional security changes to the default setup, making the system more secure for online use.

While I have compiled a little chaklist of things to double check, etc...I wonder if there is a way I can log the changes I have made *exactly*?

The only problem with relying on that CLI cache file is that it won't tell me changes I have made to config files, such as postfix, etc. Although many daemons have those helper tools to update details via command prompt...so if I learned those properly...I guess each action would be recorded exactly.

You know what is really neat about that? Is that I could effectively use that cache file to playback and entire setup/configuration so when I switch servers or screw and need a re-install...BAM...no more going through my printed list of things to do...

I suppose one could develop a shell script which pretty much prepared and configured a system to my liking automagically as well. :P

Which would be the prefered approach? I like the idea of using a shell script because of conditionals...there is no point is setting up postfix twice...

Hmmm...any pointers???

Re: Creating a log of all actions, installs, etc

Posted: Thu Aug 07, 2008 3:30 pm
by ghurtado
Hockey wrote:I know there is a log file or cache of commands executed at the CLI -- although for the life of me I cannot remember the name...
~/.bash_history

If you have more than one user in the box, they each have their own history file. This file gets truncated regularly so it may not contain everything you ever typed at the shell.
Hockey wrote: The only problem with relying on that CLI cache file is that it won't tell me changes I have made to config files, such as postfix, etc.
If you are more concerned with the changes you have made to the config files than simply having your customized file to use on a new box, you can always do a diff between a fresh install config file and one of yours, and that will give you what you changed.
Hockey wrote:I suppose one could develop a shell script which pretty much prepared and configured a system to my liking automagically as well. :P
Thats exactly how I (and almost every sane admin I have met) handle setting up new linux boxes: I have a handful of shell scripts that I run in order that do everything for me: install needed packages, configure them, etc... pretty much the same kind of tasks that you need. Embrace the power of shell scripting :)

Re: Creating a log of all actions, installs, etc

Posted: Thu Aug 07, 2008 6:50 pm
by alex.barylski
Thats exactly how I (and almost every sane admin I have met) handle setting up new linux boxes: I have a handful of shell scripts that I run in order that do everything for me: install needed packages, configure them, etc... pretty much the same kind of tasks that you need. Embrace the power of shell scripting
That is how I am going to do it...