Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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: https://github.com/seb-m/pyinotify/wiki

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

There is also Python Watchdog: http://code.google.com/p/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

 
discard

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.