4
# TemporaryDirectory in clamd.conf
6
# How long to wait for next part of RFC1341 message (seconds)
7
my $cleanup_interval=3600;
9
# ---- End of Settings ----
11
my $partial_dir = "$TMPDIR/clamav-partial";
12
# if there is no partial directory, nothing to clean up
13
opendir(DIR, $partial_dir) || exit 0;
15
my $cleanup_threshold = time - $cleanup_interval;
16
while(my $file = readdir(DIR)) {
17
next unless $file =~ m/^clamav-partial-([0-9]+)_[0-9a-f]{32}-[0-9]+$/;
19
unlink "$partial_dir/$file" unless $filetime > $cleanup_threshold;