Seems I am the devil because I didn’t put some code up that I said I would. So here it is. This is a patch to the 2.6.27 kernel that outputs all the files that have been modified, chmod, created, etc. Basically, all the files that would need to be backed up WITHOUT having to do a full system scan of a block device(Hard drive, etc). You can then use that list to know what files to back up. The backing up of the files is not part of this patch. That portion is the easy part. Exporting the files from the kernel was the harder part, and that is what this patch does.
There is also no hashing, sorting, or filtering of any kind so duplicate files could be reported - meaning a file could be modified and then before you backed it up become modified again. In that case it would output the file twice. Simply, remove the double entries to solve this issue.
If you have issues with this patch please let me know, but please don’t ask for feature enhancements or code changes unless it is critical to the use of the patch. We use a modified and updated version of this patch in house with a little different functionality and don’t have a lot of resources to keep updating a patch that we no longer use. Also, please don’t take that to mean this patch doesn’t work well, because it is fantastic for backup purposes. I only mention that we use a different version because of other functionality that we needed for a different purpose that we have combined with this patch.
Here is the link to this patch -
There are now 2 on/off switches:
/proc/sys/fs/bh_logging_user and
/proc/sys/fs/bh_logging_root
They are off by default so there should be no affect on the systems until they are turned on.
To turn them on simply echo 1 to the proper file as shown below -
echo 1 > /proc/sys/fs/bh_logging_user
echo 1 > /proc/sys/fs/bh_logging_root
It also requires a change to /etc/syslog.conf to direct the messages somewhere.
Here’s the addition I made on bhtest:
kern.debug /var/log/modified
Thanks,
Matt Heaton / President Bluehost.com