LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   ClamAV files filling up disk space (https://www.linuxquestions.org/questions/linux-server-73/clamav-files-filling-up-disk-space-674971/)

noir911 10-08-2008 01:14 AM

ClamAV files filling up disk space
 
Under /var/tmp I've got more than a thousand files and directories (mostly files) like "clamav-5491055e667dc362b68dd9719c24f9c2" - these files are owned by defang:defang. I have moved (mv) some of them to a new location to reduce disk space. I just wonder if it's ok to just delete these files? I did a "file <filename>" on one of them and it says DOS executable (EXE). Not sure what these files are.

Thanks for any suggestions.

billymayday 10-08-2008 01:18 AM

Do you have LeaveTemporaryFiles defined in clamd.conf by any chance?

noir911 10-08-2008 03:39 AM

Quote:

Originally Posted by billymayday (Post 3303737)
Do you have LeaveTemporaryFiles defined in clamd.conf by any chance?

Nope. Here is my /usr/local/etc/clamd.conf file

Code:

LogFile /var/spool/MIMEDefang/clamd.log
LogFileMaxSize 10M
LogTime yes
PidFile /var/spool/MIMEDefang/clamd.pid
DatabaseDirectory /usr/local/lib/clamav
LocalSocket /tmp/clamd
LocalSocket /var/spool/MIMEDefang/clamd.sock
FixStaleSocket yes
User defang
ArchiveMaxFileSize 20M


glyn3332 10-08-2008 05:23 AM

I had the same issue but what I did was work around it with this script:

PHP Code:

#! /usr/bin/php
<?php
    
echo "----------Spam Clean Start----------\n\n";
    
$dir '/var/virusmails/';
    
$fp opendir ($dir);
    while (
$file readdir ($fp)) {
        if (
$file == '.' || $file == '..') continue;
        if (!
is_file ($dir $file)) continue;
        
$command "rm " $dir $file;
        echo 
'Deleting: ' $command "\n";
        
shell_exec escapeshellcmd ($command) );
    }
    echo 
"----------Spam Clean End----------\n\n";
?>

I popped that in /etc/cron.daily to control it. Hope that helps but I'm sure someone has a better answer so I'll keep an eye on this thread :)

noir911 10-09-2008 05:32 PM

I was just wondering if all the files under /var/tmp can be delete without causing any harm to anywhere else? If yes, I can just empty this directory every night.

glyn3332 10-10-2008 05:04 AM

If I where you I would keep it targeted and limit to files that are a few hours old as you uploads from web apps if there are any on your server will be stored in there. But I can't see why not.


All times are GMT -5. The time now is 03:43 PM.