I'm trying to find a way to immediately move a file to another folder as soon as it appears in my dropbox on CentOS.I have scoured the internet for some clues but I can't get any further than the fact that I need to use inotify to invoke a script which will process the file as it appears.My BASH knowledge is very limited and I doubt I can write this in PHP.In other words, how can I move a file to another folder as soon as it appears using inotify?
Use inotifywait to move file when it loads in dropbox folder
bash;centos;inotify
This is a simple approach:#!/usr/bin/env bashdir=/home/ortix/Dropbox/new/target=/home/ortix/movedfiles/inotifywait -m $dir --format '%w%f' -e create |    while read file; do        mv $file $target    doneWith more details about the types of files you wanted to move, you could add some checking, logging etc...