If the folder is on a linux system you might be able to do what you want with ‘inotifywait’ as described in this stackoverflow post:
inotifywait -m -e close_write /full/path/to/folder1/ | gawk '{print $1$3; fflush()}' | xargs -L 1 occ files:scan --path=path/to/folder1