Recovering file attributes from snapshot
Andy Bair
pab at korelogic.com
Tue Jul 3 13:46:49 EDT 2007
FTimes can do what you want. It allows you to collect file attributes
before and after an event via the map mode then compare the results
using the compare mode. FTimes uses a field mask for collecting file
attributes and for the comparison. To collect all file attributes
before and after an event, you could use the commands below. Note:
these commands collect all file attributes because of the field mask
"all".
ftimes --mapauto all > ftimes.before
ftimes --mapauto all > ftimes.after
Now you can compare the before and after maps using the compare mode of
FTimes. In the example below, we only compare the uid, gid,
permissions, and file attributes between the FTimes maps.
ftimes --compare none+uid+gid+mode ftimes.before ftimes.after
Now you can take the compared results and extract the attributes you
need from the ftimes.before file and reconstitute your environment.
You can get more information on FTimes here:
http://ftimes.sourceforge.net/FTimes/index.shtml
And the FTimes man page is here:
http://ftimes.sourceforge.net/FTimes/Man+Pages/FTimes.shtml
FTimes works in all UNIX's, OSX, and Windows.
If you need more help, please give me a shout because you can do a lot
more with FTimes ... I didn't even scratch the surface.
Andy
On Tue, Jul 03, 2007 at 12:03:02PM -0400, Michael ODonnell wrote:
>
> I'm in a situation where the ownerships/permissions in a
> particular filesystem hierachy get changed by circumstances
> beyond my control (*cough*Perforce*cough*) and I need to
> force them back before I can use that hierachy. I'm prepared
> to script a solution if necessary but I hate reinventing the
> wheel so I wonder if this tool already exists. It'd basically
> allow me to snapshot the desired attributes (ie. just certain
> metadata items, not the contents) of an arbitrary set of
> files/directories/symlinks/etc and then later allow me to
> restablish those metadata by referring to the snapshot, but
> leaving the data unchanged.
>
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
--
Andy
KoreLogic Security
603.465.3236 (Office)
603.340.2498 (Mobile)
http://www.korelogic.com
GnuPG Fingerprint: 688A 79EC B1E5 5748 CE87 1F20 2C45 60E7 0583 23B6
More information about the gnhlug-discuss
mailing list