Solved Any kind of a automatic root's journal?

  • Thread starter Thread starter Deleted member 43773
  • Start date Start date
D

Deleted member 43773

Guest
As root your doing lots of thing to many files in very different paths.
Especially when moving from one system to another you want to remember what you have done where, why, and also maybe how, or even how not (comments).

Yet I wrote down in excersize books what I've done where, and I added all edited system and config files to a tarball.
Besides it's not only additionally work, and it would be much better to keep this journal on the system itself, above all it's done manually.
You cannot be sure to have every single small change you're made quickly just to test something.

I was thinking as putting a version control system on. But I also think running something like svn over whole / ....would be not the very best idea at all.
...maybe only on selected pathes like /boot, /etc, /usr/local/etc....
BUT in over 50 years of unix-systems I cannot be the first one asking this question.
So before I do something stupid or at least waste redundant effort,
lets hear, what the community says, first.
 
Lot's of folks use/have used version control systems for stuff like this. Pick whatever one you're comfortable with and use it. I've used CVS, SVN and git to do this locally. I've also simply used tarballs and stored them off the "system" disk.

What to store? Depends on what you want it for. Think about what you do installing a new system. Ignore user home directories. You make changes in /etc (maybe in some subdirectories of it), /usr/local/etc (and maybe some subdirectories), you may make changes in /boot/loader.conf, you install packages.

That's the kind of stuff I would (have) saved. If you're serving anything make sure you save that configuration (DNS, SSH, NTP, firewall config), if you are running any jails or VM save the configuration or if you have enough storage space you could even snapshot and store those.
 
Thank you!
So I see, I'm not the only one with this issue, and also I'm pretty clear about it, and I wasn't misunderstood. :)
...and my idea facing this with version control system was not completely wrong after all.
Thanks.
 
Nope you are not the only one. I've even used version control to keep track of stuff in my $HOME directory (think like .cshrc/.tcshrc stuff, maybe even application config files).

One just needs to get in the habit of using the tools. I don't know if there are any tools that would help you automate the process. It would be nice if you had a tool where you set up your local version control, have a config file pointing to local repo, then you edit rc.conf and when you save it and quit the editor you are asked for a commit message and the update is checked into your version control. There may be something like this, I've never actually looked.

The tarball method is useful because you don't need anything other than the base system.
Example:
I've always tried to have a system disk and a "data" disk where the data disk has my user home directories. That way when upgrading a system, say from FreeBSD-11 to FreeBSD-13 I will buy a new device for a fresh install, create a tarball of all the important config things over on the data disk, shutdown, install the new device, and unplug the old system device, power back up and do a fresh install. After all done, I can simply untar the old config and manually merge it to the new system.

Overly cautious? Absolutely, but it makes sure I don't select the wrong device, if anything goes very wrong, power down, swap a couple cables and back in business. I let the new system run for a bit making sure it's good before retiring the old system device. Yes I wind up with a bunch of reusable devices, but they come in handy for experimentations or even loaning out. dd if=/dev/random works as a quick way to clear them. And yes I know for true security you need to triple clear and toss in the fireplace.
 
If your files are on ZFS (which they should), and you want to find out which files you have modified/deleted/created/renamed, there's the very nifty zfs-diff(8) command which instantly displays compact diffs between snapshots. I always create a "pristine" snapshot after system installation so I can track all files that changed. This list can serve as a comprehensive list of files to add to your tarball.

As for logging what commands the root user ran, there's certainly some accounting method which I never used. One lazy low tech way would be to increase the root shell's history to some huge value. Or maybe get into the habit of exclusively using sudo with appropriate logging.
 
Back
Top