#!/bin/bash # Script untuk memonitor siapa yang membuat/mengubah file index.php TARGET_DIR="/home/t56599/diskominfo.burukab.go.id" # ganti sesuai folder WordPress kamu LOGFILE="/tmp/index_monitor.log" echo "🚨 Monitoring file index.php di $TARGET_DIR - $(date)" >> "$LOGFILE" # Jalankan inotifywait untuk memantau create/modify event inotifywait -m -r "$TARGET_DIR" -e create -e modify --format '%w%f %e %T' --timefmt '%Y-%m-%d %H:%M:%S' | while read FILE EVENT TIME; do if [[ "$FILE" =~ index.php$ ]]; then echo "[$TIME] File $FILE $EVENT" >> "$LOGFILE" # Tambahkan informasi proses yang aktif ps -eo pid,ppid,cmd --sort=start_time | tail -n 20 >> "$LOGFILE" echo "----------------------------------------" >> "$LOGFILE" fi done