0

i'm using vsftp on ubuntu 9.04 Is it possible to send an email whenever a user uploads a file to a particular folder using ftp?

2

I don't think vsftpd itself has anything that will do this for you. Most likely you'll have to write / find a script that will watch a particular directory for files, and email it from there.

0
1

You can enable logging for vsftp and then look for files being uploaded in taget directory.

 #!/bin/sh

 tail -F /var/log/vsftpd.log | while read line; do
     if echo "$line" | grep -q '/path/to/target/folder'; then
          echo "File is uploaded" | /usr/sbin/sendmail "foo@bar.com";
     fi
 done
1
  • what if the vsftp log rotates - the script will go idle
    – TSG
    Nov 25 '18 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.