Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to be notified and perform other tasks when a file is uploaded onto my server. Is there any method/system call that will be triggered or anything that i can hook onto ? I'm using vsftpd as my ftp server.

share|improve this question
up vote 2 down vote accepted

You can approach this by using something more generic than a FTP hook (which will also allow it to scale if the users uses SCP, SFTP or even SSH using a text editor): inotify.

There are many languages that support this, but here's a Python API:

This would allow you to watch a directory, and when it changes, act on that information.

There is also Python Watchdog:

share|improve this answer
Thanks. Am looking into this. Any idea which event will be triggered at the end of a file transfer ? – rdsoze Sep 25 '12 at 8:33
FTP clients normally upload files in with a filename like ".something" and rename them when they're done, so you can just ignore hidden files if that's the case and just wait for the 'real' file to be created. – Jay Sep 25 '12 at 10:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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