Last active
May 2, 2018 14:24
-
-
Save bagf/c91e79ccae234c0f25f688b956fade53 to your computer and use it in GitHub Desktop.
Trigger after FTP upload
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/sh | |
# @see https://stackoverflow.com/questions/10956668/run-a-shell-command-when-a-file-is-added | |
tail -n 0 -F /var/log/vsftpd.log | while read line; do | |
if echo "$line" | grep -q 'OK UPLOAD:'; then | |
filename=$(echo "$line" | cut -d, -f2) | |
#if [ -s "/srv/$filename" ]; then | |
echo "Got: $filename" | |
#fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment