FTP - notify a user when a file is uploaded?
Xserve Quad-Core 2.8 GHz, Mac OS X (10.5.1)
Xserve Quad-Core 2.8 GHz, Mac OS X (10.5.1)
#!/bin/bash
folderToWatch="/Volumes/Misc/Misc/FTP"
clientName="John Smith"
clientEmail="client@email.com"
fromName="FTP Server"
fromEmail="from@ftp.com"
subjectLine="Files Uploaded!"
files=files.$$
find $folderToWatch/* -newer timestamp -print > $files
if [ -s "$files" ]
then
mail=mail.$$
echo "To: $clientName<$clientEmail>" >> $mail
echo "From: $fromName<$fromEmail>" >> $mail
echo "Subject: $subjectLine" >> $mail
cat $files >> $mail
/usr/sbin/sendmail -t < $mail
rm $mail
fi
rm $files
touch timestamp
find /path/to/folder/* -newer timestamp -print
folderToWatch="/Volumes/Macintosh HD/Misc/FTP"
FTP - notify a user when a file is uploaded?