I'll need a Shell (Bash) script (rather an exact command) that outputs
a) files' name in the Solaris system, one file per line in the UNIX systems
b) that were modified/created the last 1470 minutes
c) exclude FIFO files, symbolic links, sockets (ie *.sock)
d) names of files of between 1 byte to 20MB in size
e) files in /dev, /devices, /kernel, /cdrom, /platform, /proc, /net
f) files mounted on NFS
I have about 1million files so hoping the command/script of outputting
the file can complete in 30mins, so may need efficient coding.
I need to amend the following script to read (ie for AV to scan) the above output file:
#!/bin/bash
LOGFILE="/var/log/clamav/`hostname`-$(date +'%Y-%m-%d').log";
## suggest to change dirs below to root but exclude databases
DIRTOSCAN="/var /opt /home /etc /tmp /export";
for S in ${DIRTOSCAN}; do
DIRSIZE=$(du -sh "$S" |grep -v "/proc" |grep -v "/dev" |grep -v ... /2>/dev/null | cut -f1);
## add to grep -v for any other file types to exclude
echo "Starting a daily scan of "$S" directory.
Amount of data to be scanned is "$DIRSIZE".";
clamscan -ri "$S" >> "$LOGFILE";
f) files mounted on NFS
should read
f) files not mounted under NFS