Skip to content

Instantly share code, notes, and snippets.

@bluefangs
Created March 6, 2018 17:34
Show Gist options
  • Save bluefangs/14c521a966459fdf1a64a1d38da4ebed to your computer and use it in GitHub Desktop.
Save bluefangs/14c521a966459fdf1a64a1d38da4ebed to your computer and use it in GitHub Desktop.
inotifywait -m /home/test -e create |
while read path action file; do
echo "The file '$file' appeared in directory '$path' via '$action'"
mv $path$file /home/test/archive/
# do something with the file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment