|
|
Subject: Help - how to get a snapshot (all file names, size, ownership, ?etc.) of a Linux system?
From: Jim Richardson
Date: 12/18/2007 1:30:30 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, 17 Dec 2007 16:14:16 -0800 (PST),
lx282828@gmail.com <lx282828@gmail.com> wrote:
> On Dec 17, 5:36 pm, tha...@tux.glaci.delete-this.com wrote:
>> lx282...@gmail.com wrote:
>>
>> > What I intend to do is to keep a snapshot of my RH Linux + our
>> > production items before I upgrade it. This way, when I donwgrad it to
>> > the original version, I can easily compare and see if the original
>> > environment and the upgraded-then-downgraded environment are the same
>> > (all files and their attributes are the same). So, the snapshot I'm
>> > looking for should contains all files and their attributes (size, date-
>> > time, ownership, access control, etc.). With this said, do you think
>> > what you suggested ("ls -laR / > system-snapshot.txt", and "find / -
>> > depth -ls > system-shapshot.txt")is sufficient?
>>
>> > Regards,
>> > BJ
>>
>> Yes, either would work, though I suggest using the 'find' method.
>> You can then use the 'diff' command to compare various versions of
>> snapshot files and see exactly which files have changed and where
>> they are located. For example:
>>
>> diff snapshot-old.txt snapshot-current.txt
>>
>> That will show you exactly which lines are different in the
>> two files.
>>
>> Thad
>> --
>> Yeah, I drank the Open Source cool-aid... Unlike the other brand, it had
>> all the ingredients on the label.
>
> Hi Thad,
>
> I tried both methods you mentioned. They seem exactly what I'm look
> for. Thanks!
>
> Tow follow-up questions if you don't mind:
>
> Q1: the output of "find / -depth -ls > system-shapshot.txt" contains
> two extra columns than the output of "ls -laR / > system-
> snapshot.txt". For example:
>
> 574740 4 -rw------- 1 bill bill 83 Dec 10
> 2004 ./.kde/share/config/kdeprintrc
> 574741 4 -rw------- 1 bill bill 23 Dec 10
> 2004 ./.kde/share/config/kcmnspluginrc
>
> What do the numbers in the first two columns (for example 574740, 4)
> mean ?
>
The first number is the inode, and the other, the number of blocks used.
find with the -ls switch mimics ls -lids format
- -l long listing
- -i inode
- -d directory only, no deref.
- -s size (in blocks, default is 1024K blocks IIRC)
> Q2: Our product is an application that runs on top of RH Linux. I
> assume after we upgrade our release, use it for a while then downgrade
> it, some files will get changed. The question is besides /var/log/
> *.log files, what else files could be changed on Linux over a short
> period of time (days)? If we know the files that may get changed, we
> can exclude them when running "diff".
>
Might want to look at something like tripwire,
<http://sourceforge.net/projects/tripwire/>
or filewatch <http://sourceforge.net/projects/filewatch/>
rather than starting from scratch.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHaDv1d90bcYOAWPYRAhWDAKDpQ4RUQm7UsGI3WH/FZ+K+9FssPACfafKg
QZYS2IdtD0SDgSWv1zG5cJI=
=509o
-----END PGP SIGNATURE-----
--
Jim Richardson http://www.eskimo.com/~warlock
I have plenty of talent and vision. I just don't give a
damn.
|