<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Rodrigo Barbosa wrote:
<blockquote cite="mid20051225020648.GA12096@suespammers.org" type="cite">
<pre wrap="">-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sat, Dec 24, 2005 at 10:49:25AM -0600, rado wrote:
</pre>
<blockquote type="cite">
<pre wrap="">find is giving me fits!
this command is really the heart of a backup script I am trying to get
going.
here's the line:
if find / -mtime -1 -type f | xargs clamscan -
l /var/log/clamav/clamscan-bu-daily.log $clamexcludes -r --no-summary |
cut -d: -f1 > /usr/local/bin/changedfilelog; then
and the clamexcludes:
clamexcludes="--exclude=/sys/bus/pci/drivers --exclude=/proc --
exclude=/sys/class/scsi_host --exclude=/usr/share/doc/clamav-0.87 --
exclude=/usr/lib/mailman/tests/msgs "
kk ...when it's all over...I have to have /var/log/clamav/clamscan-bu-
daily.log to be w/out FOUND or ERROR words anywhere. if either of these
words are in that file, the system will not back up but instead, email
me.
the immediate problem is...no matter what I try, the find command does
not perform as I want.
the file seems to load up like 280,000 files which seems like the total
system etc.
</pre>
</blockquote>
<pre wrap=""><!---->
There are actually easier ways to do it, you know. You can first
run clanscan, then check the logfile with either grep or sed to make
sure it is what you want it to be, and based on that result decide
what to do with an if statement.
Something like this:
find / -mtime -1 -type f --exec clanscan -l \
/var/log/camav/clanscan-bu-daily.log \
$clanexcludes -r --no-summary "{}" \; | \
cut -d: -f1 > /usr/local/bin/changedfilelog
NOTOK=`cat /var/log/clamav/clamscan-bu-daily.log | sed -n -e '/FOUND/p;/ERROR/p'`
if [ "${NOTOK}" != "" ]; then
....
I can't actually test this here, since I don't use clanscan, but it is
supposed to do what you want.
[]s
- --
Rodrigo Barbosa <a class="moz-txt-link-rfc2396E" href="mailto:rodrigob@suespammers.org"><rodrigob@suespammers.org></a>
"Quid quid Latine dictum sit, altum viditur"
"Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFDrf64pdyWzQ5b5ckRAuHbAJkBTw0AMYXRvafnoXdkt4XmawXcdACdGIst
zMezfdBk2VnwhBQpzpJmK50=
=zIME
-----END PGP SIGNATURE-----
_______________________________________________
CentOS mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CentOS@centos.org">CentOS@centos.org</a>
<a class="moz-txt-link-freetext" href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a>
</pre>
</blockquote>
Speaking of the 'find' command, I believe I found an inconsistency just
a few hours ago. In "man find", it states that when testing by size,
the suffixes b, c, w, k, M and G are valid. However, the texinfo
document makes no mention of the 'M' or 'G' suffixes. The command
appears to work like the info file says.<br>
[rj@mavis download]$ find ~ -depth -type f -size +600M -print<br>
find: invalid -size type `M'<br>
[rj@mavis download]$ <br>
Using a size test "-size +600000k" instead works fine.<br>
<br>
This is with CentOS 4.2, fully updated.<br>
[rj@mavis download]$ rpm -q findutils<br>
findutils-4.1.20-7<br>
<br>
<br>
<div class="moz-signature"><br>
</div>
</body>
</html>