Last active
August 29, 2015 14:07
-
-
Save v-thomp4/ffed5c2be5945982a9d9 to your computer and use it in GitHub Desktop.
monitor folder and send mail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
inotifywait -m /path/to/folder -e modify,create -e moved_to | | |
while read path action file; do | |
echo "The file '$file' appeared in directory '$path' via '$action'" | mailx -s 'Monitor File' your_email.com | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment