0

I have a directory of files on my Ubuntu machine. I run python 2.6. All of these files are represented in a database for purposes of sorting, searching, locating, etc. I'd like to trigger a python script every time a file is added or modified to update said database.

basically, upon adding, moving, deleting, or renaming a file, a script would be called to make update queries to SQL database.

similar post here. however, I would like to directly feed such a file into a script - plus I was confused - pynotify or gio? what can detect deleted files? doesn't seem like these are best.

any ideas on how to do this?

Community
  • 1
  • 1
lollercoaster
  • 14,621
  • 31
  • 104
  • 168

1 Answers1

2

Use incron to run a script that gets passed the new filenames.

Ignacio Vazquez-Abrams
  • 740,318
  • 145
  • 1,296
  • 1,325