1
Alert when z file on linux server has been changed by x user.
#/bin/sh
old_time=`stat -c %z /var/spool/cron/root`
if [[ "$new_time" != "$old_time" ]];
then
echo -e "Changes has been made in Cron file" | mail -s "Modification alert" [email protected]
echo -e "$old_time"
echo -e "$new_time"
else
echo "no change"
fi
其實我想跟蹤z文件中由n個用戶訪問z文件的任何變化的用戶。我想用上面的腳本至少得到一個警報時,z文件被改變。我不知道如何跟蹤哪個用戶改變了它。當linux服務器上的z文件被x用戶更改時的警報