From: klavs klavsen (kl_at_vsen.dk)
Date: Thu 14 Mar 2002 - 22:04:28 GMT
On Tue, 2002-03-12 at 13:20, Sam Vilain wrote:
> klavs klavsen <kl_at_vsen.dk> wrote:
> > Watch out for the comparison. A file can look exactly alike, according
> > to ls -l, and still not be the same. I would definetely do a sha1 or
> > md5sum check to ensure that they are truely identical.
> So would I. Read the source ;-).
> > sounds very cool.. perhaps i'll have a look at making it log, which
> > files it vunified - and then the next day, you could run it against the
> > log, and it would tell you if anything changed - a very simple but
> > effective IDS.
> Check out the -v flag, which will only print out the new unifications that
> are made.
> It won't print anything when a file that was hard linked and indentical is
> now a different file, however.
> Patches are welcome. Even horrid hacks are welcome, but you get more
> style points for writing good code.
I just took a little time to think my idea through.
1 comment to your program (without having scrambled through the entire
source - sorry). it takes dir1 and 2 as input. You don't state which is
the source and which is the target - where the target is the file that
actually gets deleted and hardlinked..
and if indeed dir2 is the target, it ought to verify that the filepath
contains /vserver in the start.. (or perhaps checks the vserver conf
file, for the vservers dir).
perhaps you should think of making it so one could just state the
vservers one wanted unified.. like unify-dirs root skel (root being the
real / server and skel being a server under /vservers/skel).
I came up with these extra options for unify-dirs:
-s --save <filename>
save list of files in /etc/vserver/unified.vservername if no <filename>
-c --compare compare <filename>
compare current link status with saved list (see -s :-)
don't actually do any linking. just print out list of files that could
be unified. together with -s option one could merely create an initial
list, without doing anything else..
What do you think?
-- Regards, Klavs Klavsen
-------------| This mail has been sent to you by: |------------ Klavs Klavsen - Open Source Consultant kl_at_vsen.dk - http://www.vsen.dk
Get PGP key from www.keyserver.net - Key ID: 0x586D5BCA Fingerprint = A95E B57B 3CE0 9131 9D15 94DA E1CD 641E 586D 5BCA --------------------[ I believe that... ]----------------------- It is a myth that people resist change. People resist what other people make them do, not what they themselves choose to do... That's why companies that innovate successfully year after year seek their peopl's ideas, let them initiate new projects and encourage more experiments. -- Rosabeth Moss Kanter