Created
February 16, 2017 10:57
-
-
Save Magneticdud/0be7f11b25c73eb3800b11ee5add9a89 to your computer and use it in GitHub Desktop.
Automagically send new files via email
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
inotifywait -m /files/ -e create -e moved_to | | |
while read path action file; do | |
echo "The file '$file' appeared in directory '$path' via '$action'" | |
echo "waiting 30s" | |
sleep 30s | |
# do something with the file | |
sendEmail -o tls=yes -f [email protected] -t [email protected] -s smtp.email.it:587 -xu [email protected] -xp mypassword -u "Scansione" -m "Invio scansione" -a /files/$file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment