Wget http://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz
Wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
Wget http://inotify.aiken.cz/download/incron/incron-0.5.9.tar.bz2
Tar zxvf inotify-tools-3.14.tar.gz
Cd inotify-tools-3.14
./Configure
Make
Make install
Man inotify test whether the installation is successful
Tar xvf incron-0.5.9.tar.bz2
Cd incron-0.5.9
Make
Make install
Tar xvf sendEmail-v1.56.tar.gz
Music sendEmail-v1.56 sendEmail
Vi/etc/vsftpd. conf
Add at the end:
Dual_log_enable = YES
Use_localtime = YES
Vsftpd_log_file =/var/log/vsftpd. log
In touch/var/log/vsftpd. log
The above operation is to generate the vsftpd log File vsftpd. log
Service vsftpd restart #### restart a service ####
Vi/home/shell/ftp. sh
#! /Bin/bash
/Home/shell/sendEmail-f XXX @ XXX-t XXX @ XXX-s smtp. XXX-u "who logged on to my FTP server:"-xu user-xp passwd-m time: 'Tail-1/var/log/vsftpd. log | awk '{print $1, $2, $3, $4, $5} ''### user and IP: 'Tail-1/var/log/vsftpd. log | awk '{print $8, $12} ''### action: 'Tail-1/var/log/vsftpd. log | awk '{print $10} ''###, Come in Target: 'Tail-1/var/log/vsftpd. log | awk '{print $13, $14 }''
# Incrond ### start the monitoring tool ###
# Incrontab-e
/Var/log/vsftpd. log IN_MODIFY sh/home/shell/ftp. sh
### Here is a brief description of incrond ####
Incron is the cron system of inotify. Like cron of system itself, it contains an incrond and an incrontab ), unlike the cron of the system itself, the operation on folders or files is not the operation on time.
######################################## ###############################
Create an FTP user
Useradd test
Paaswd test
Test: Use test to log on:
Email Alert:
When you use teset to create a folder and rename it:
Email Alert: