I think there was a USS tools&toys thing (fscp?) that'd compare the contents of 
two filesystems that I used to run when converting those from HFS to ZFS years 
ago, but the tools&toys page is gone now so I can't grab that to check.  Pretty 
sure it wouldn't work for what I want to do anyhow, which is to compare the 
files/directories/etc in two paths that could be in different locations in 
their filesystems.  Is there something else that says "this guy's missing, this 
one's new, the attributes (or better yet contents) of these are different" for 
USS?  I cobbled together this from something a coworker had that compared just 
directories-and made it compare the listings of those directories-but the 
output's a little ugly.  Do you have or know of anything better?
#!/bin/sh
# Change these variables:
NEWDIR="/my/new/path"
OLDDIR="/my/old/path"
#
# Leave these as-is unless you know what you're doing
FDOPT="-type d -xdev"
LSDIR="-exec ls -lAs {}"
TMPFILE1=/tmp/find1.out
TMPFILE2=/tmp/find2.out
TMPOUT=/tmp/compare.out
#
# Gather the new directory listing and stick in in TMPFILE1
echo "Starting directory " $NEWDIR > $TMPFILE1
PRDIR="-exec echo ---- Scanning ${NEWDIR}/ {}"
cd $NEWDIR
find . $FDOPT $PRDIR \; $LSDIR \; >> $TMPFILE1
#
# Gather the old directory listing and stick it in TMPFILE2
echo "Starting directory " $OLDDIR > $TMPFILE2
PRDIR="-exec echo ---- Scanning ${OLDDIR}/ {}"
cd $OLDDIR
find . $FDOPT $PRDIR \; $LSDIR \; >> $TMPFILE2
#
# compare the listing files and save it in TMPOUT:
diff -c0 $TMPFILE1 $TMPFILE2 > $TMPOUT
#
# display the results:
cat $TMPOUT
#
# clean up the temporary files:
rm $TMPFILE1
rm $TMPFILE2
rm $TMPOUT

Thanks!


Shannon Collinson
Senior Principal Infrastructure Engineer/Advisor
Mainframe Engineering - zOS and Innovation / Truist
Office: 404-827-6070 / Mobile: 404-642-1280
[email protected]<mailto:[email protected]>




The information transmitted is intended solely for the individual or entity to 
which it is addressed and may contain confidential and/or privileged material. 
Any review, retransmission, dissemination or other use of or taking action in 
reliance upon this information by persons or entities other than the intended 
recipient is prohibited. If you have received this email in error please 
contact the sender and delete the material from any computer.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to