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
  • 15,969
  • 35
  • 115
  • 173

1 Answers1

2

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

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358