Here's an offsite answer that might help you: http://johnstanfield.com/?p=683
While the author of that page knew exactly how many attachments he wanted to use in his email, it seems that you do not and so his final answer (do a bunch of uuencode
commands concatenated by &&
and then pipe that to mail
) may be not be the best fit for you. But take a look at his second answer:
uuencode file1 first_file >> uu.txt
uuencode file2 second_file >> uu.txt
cat uu.txt | mail -s "a bunch of files" me@mydomain.com
rm uu.txt
You could easily replace the first two lines with a for
loop that creates uu.txt
with every file in /tmp/camera
:
for file in `ls /tmp/camera`; do
uuencode $file dummyname >> attachments.txt
done
cat attachments.txt | mail -s "Motion Capture Images" me@mydomain.com
As for zipping, that too would be easily accomplished:
cd /tmp/camera
tar czvf MotionCapture.tar.gz *.jpg #or replace jpg with your images' file extension
FTP might be a little more difficult because of its interactivity. I don't have much experience with it, so I'll just point you here: http://kb.iu.edu/data/afqg.html