mardi 3 février 2015

Use inotify to detect what FTP user changes a file for revision history?


I've set up inotify using incron to detect if a file in the web root is changed. I'm using the triggers IN_MODIFY and IN_MOVED_TO and when it triggers, a bash script copies the file to a specific folder, and names it filename.php_150203_170222.php (filename, date, time, extension)


What I really want is to also add the username of the FTP user that uploaded/changed the file, like filename.php_150203_170222_mike.php. The problem is that when someone uploads a file that overwrites an existing file, the username of the file remains the original creator.


I have a separate incron for each ftp user, but it's always the first user that gets the trigger, and that's the username running the script.


How can I track this, so the bash script knows who uploaded the file? Perhaps with audit, if so, how?



Aucun commentaire:

Enregistrer un commentaire