Just wonder if there are ways to find out any files missing(accidently
deleted) or changed on a system.
Thanks for advice!
Thanks for advice!
-- ICE
Quote:> Just wonder if there are ways to find out any files missing(accidently
> deleted) or changed on a system.
> Thanks for advice!
Thanks!
Off hand, I can think of two ways:Quote:> Thanks for reply. Suppose you donot know what file has been removed. Is
> there a way?
> Thanks!
1) check every package on the system (verbose) with a script like:
#!/bin/ksh
for pkg in $(pkginfo | awk '{print $2}'); do
pkgchk $pkg
done
[ should work on all versions of Solaris ]
2) check each package file individually and report missing ones
#!/bin/ksh
for file in $(cat /var/sadm/install/contents | cut -c-256 | awk '{print
$1}'); do
echo $file | grep '=' >/dev/null 2>&1
if [ $? -eq 0 ]; then
link=$(echo $file | sed 's/=.*$//')
if [ ! -h "$link" ]; then
echo "$link: symbolic link missing"
fi
else
if [ ! -f $file ]; then
echo "$file: file missing"
fi
fi
done
[ won't work on Solaris 10 ]
[ won't work with pathnames longer than 256 characters - the 'cut' is
there because some lines in /var/sadm/install/contents are too long for awk
to handle ]
Note that files which don't belong to a package can't be checked.
Disclaimer: above scripts written on the fly, so may not be 100% correct...
:)
--
-- ICE
--
Checkout tripwire.Quote:> Thanks for reply. Suppose you donot know what file has been removed. Is
> there a way?
> Thanks!
--
Rodrick R. Brown
Unix Systems Admin
http://www.rodrickbrown.com
When in 1986 Apple bought a Cray X-MP and announced that they would use it
to design the next Apple Macintosh, Seymour Cray replied, "This is very
interesting because I am using an Apple Macintosh to design the Cray-2
supercomputer."
- Logan
1. How to find out application that send outs packets on certain port
Hello,
our firewall tells me that a machine is trying to send out packets on 2
different ports every 5 to 10 minutes.
Is there a easy way to find out the application that sends this packets ?
Thank you
Andreas
3. Missing software ... find what I'm missing
4. Unix Programming FAQ (v1.37)
5. How to find missing/needed header files?
7. missing file - in which package do I find libqt.so.2
9. How can I find a missing "#endif" in nested include files?
10. - Two questions: find files with specific permission, find files that belong to..
11. libpng.so.3 - missing library file missing
12. OS 5.6 File Manager (missing files)
13. Install problems: missing files, read-only file system