Last active
May 5, 2025 07:23
-
-
Save neilgee/2bb861ad1396bf7d358230fd47b66a8b to your computer and use it in GitHub Desktop.
Maldet Alternate Cron
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Paths to scan | |
SCAN_PATHS=( | |
"/home/?/webapps/?" | |
) | |
# Days of modification to scan | |
SCAN_DAYS=1 | |
# Log file location | |
LOG_FILE="/var/log/maldet-custom.log" | |
# Timestamp | |
echo "===== $(date '+%Y-%m-%d %H:%M:%S') =====" >> "$LOG_FILE" | |
# Run maldet scan for each path (foreground for manual testing) | |
for path in "${SCAN_PATHS[@]}"; do | |
echo "Scanning: $path" >> "$LOG_FILE" | |
/usr/local/maldetect/maldet -r "$path" "$SCAN_DAYS" --report >> "$LOG_FILE" 2>&1 | |
done | |
echo "" >> "$LOG_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment