I goofed

I goofed

Post by Tapio Luukkane » Wed, 03 May 2000 04:00:00



I decided to convert a few file systems on a HP-UX box from hfs-format
to vxfs-format, and at the same time rename the disks and rearrange
the directories between them.

While moving the directories accross disks, I goofed the file
modification times by using just 'cpio -pdx' (no '-m' option).  I
don't know what I was thinking. Two many balls in the air at the same
time, I'd suppose.

Now, I could restore all the directories from backup tapes, but it
would feel safer and also be easier to have a way to just fix the file
timestamps, because the directories do not reside under the same mount
points anymore, and especially because the users have of course
started updating the files.

So, does anyone have or know about a script which can compare the
contents of two directory trees, say A and B, and set the timestamps
of files in A to those of the respective files in B, if the file
contents are identical ?

Or does an old man need to see the true light, re-focus his
aspirations, and strive to become _a perl hacker_ ?

-Tapio.

 
 
 

I goofed

Post by Jehs » Wed, 03 May 2000 04:00:00


Probably the easiest way would be to parse the ls output of the
original directory, and get the date of the file from that. Then,
use the touch command to set the timestamp on the corresponding
file to the same thing.


Quote:> So, does anyone have or know about a script which can compare the
> contents of two directory trees, say A and B, and set the timestamps
> of files in A to those of the respective files in B, if the file
> contents are identical ?

It's probably a pretty involved script, and it's 2 hours from a final
exam for me, so I can't post you any code :).
Maybe later.

Good luck,
Moshe

--

Geek code v3.12 (www.geekcode.com):
GCS/E d- s+:-- a-- C++$ UL++>+++$ P+>++ L+++>$ E--- W+ N++ w--
!O M-- V? PS+ PE Y+ !PGP t 5? X+ R- tv b- DI+ D+ G e>++ h r y

 
 
 

I goofed

Post by Randal L. Schwar » Wed, 03 May 2000 04:00:00


Tapio> So, does anyone have or know about a script which can compare the
Tapio> contents of two directory trees, say A and B, and set the timestamps
Tapio> of files in A to those of the respective files in B, if the file
Tapio> contents are identical ?

This is a somewhat incomplete specification (like, do you really wanna
restore a-times?, and can you afford ctime updates on all the files?),
but you might want to look at the last program in:

        http://www.stonehenge.com/merlyn/UnixReview/col16.html

and then mix that with File::Compare from the CPAN to see if it's
identical, and then mix that with the stat() operator on the source
to get atime/mtime and utime() on the destination file.

Probably about 20 minutes of work (for me :).  Hope it's less than
2 hours for you. :)

print "Just another Perl hacker,"

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

 
 
 

I goofed

Post by Michael Sternber » Wed, 03 May 2000 04:00:00



> So, does anyone have or know about a script which can compare the
> contents of two directory trees, say A and B, and set the timestamps
> of files in A to those of the respective files in B, if the file
> contents are identical ?

A shell solution:  if you have (a) civilised filenames and (b) the trees ARE
identical:

    cd /goofed/dir; find . | xargs -n1 -i touch -r /backup/dir/'{}' '{}'

You may want to echo first instead of touch blindly.

If the conditions don't hold:  (a) - sprinkle with some more quotes; (b) - if
the referenced file doesn't exist in the backup, the point is moot.

Regards,
--
Michael Sternberg                        | Uni-GH Paderborn
http://www.phys.uni-paderborn.de/~stern/ | FB6 Theoretische Physik
phone: +49-(0)5251-60-2329   fax: -3435  | 33098 Paderborn, Germany
"Who disturrrbs me at this time?"  << Zaphod Beeblebrox IV >>     <*>

 
 
 

1. I Goofed

Hello;

        I seem to have goofed (or I am missing something in the manual).  
The later is more likely.  I have two scsi drives.  Everything seemed to
be working fine except that I will be starting to do some things that
will need more swap space.  Simple enough I thought, repartition the
second disk to add swap space.  I did that.  After backing up the
filesystems on that disk I ran divvy and decreased the size of the two
partitions and added a swap space after the partitions, no overlap.  
Reloaded the data onto the system and rebooted.  Every thing came up
running.  Then I tried to do "swap -a /dev/dsk/1s3 0 64000".  No joy.  I
get the following message; "swap: No such device or address".  I have
gone over and over the manuals and can't find a clue as to what step I am
missing.

        I hope that some one can offer me a clue as to what step I left out.
As usual I believe that an email reply would be best to cut down on band
width.

        If there is enough interest I will sumerize the answers to the net.

        Thanks bel

Robert E. Laughlin     NCCOSC RDT&E Div (NRaD)          |The problem with
These opinions are mine.  I do not speak for NRaD.      |making software idiot-


2. Finding LAT emulator for Solaris

3. stdlib.h goof's up, HELP!!!!

4. Need info on Veritas

5. CONTEST: C goof protection poetry (was: How do you pronounce "char"?)

6. increase mem -> increase cpu performance ?

7. scandisk goofed up lilo?

8. LINUX Memory Compatability...

9. Oops! I goofed (vtprint 1.22)!

10. CORRECTING MY GOOF!

11. Ahem...goofed up, well, something

12. Nawk Math goof-up

13. 2.1 Gbyte Linux 3.0.0 April 96 install goof-ups...