Skip to content

Commit 0efd422

Browse files
committed
[New] added conf.maldet option cron_prune_days for configuration cron.daily pruning max age of quarantine/sess/tmp data
issue #197
1 parent 322b329 commit 0efd422

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

cron.daily

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ if [ -z "$scan_days" ]; then
3434
scan_days=1
3535
fi
3636

37+
if [ -z "$cron_prune_days" ]; then
38+
cron_prune_days=21
39+
fi
40+
3741
if [ "$find" ]; then
3842
# prune any quarantine/session/tmp data older than 7 days
3943
tmpdirs="$tmpdir $varlibpath/sess $varlibpath/quarantine $varlibpath/pub"
4044
for dir in $tmpdirs; do
4145
if [ -d "$dir" ]; then
42-
$find $dir -type f -mtime +7 -print0 | xargs -0 rm -f >> /dev/null 2>&1
46+
$find $dir -type f -mtime +${cron_prune_days} -print0 | xargs -0 rm -f >> /dev/null 2>&1
4347
fi
4448
done
4549
fi

files/conf.maldet

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ autoupdate_version="1"
4848
# [0 = disabled, 1 = enabled]
4949
autoupdate_version_hashed="1"
5050

51+
# The retention period, in days, which quarantine, temporary files and stale
52+
# session information should be retained. Data older than this value is deleted
53+
# with the daily cron execution.
54+
cron_prune_days="21"
55+
5156
# When defined, the import_config_url option allows a configuration file to be
5257
# downloaded from a remote URL. The local conf.maldet and internals.conf are
5358
# parsed followed by the imported configuration file. As such, only variables

files/internals/importconf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ autoupdate_version="1"
5050
# [0 = disabled, 1 = enabled]
5151
autoupdate_version_hashed="1"
5252

53+
# The retention period, in days, which quarantine, temporary files and stale
54+
# session information should be retained. Data older than this value is deleted
55+
# with the daily cron execution.
56+
cron_prune_days="$cron_prune_days"
57+
5358
# When defined, the import_config_url option allows a configuration file to be
5459
# downloaded from a remote URL. The local conf.maldet and internals.conf are
5560
# parsed followed by the imported configuration file. As such, only variables

0 commit comments

Comments
 (0)