Watch a directory and keep state in sync with a databse.