I'm trying to use Mutt to send specific files in a folder. I have a folder titled "Image Cache" that, with a picture being taken every second, has 30 seconds of pictures in it. I would like to use Mutt to put 15 seconds worth of pictures into an email as attachments and send them to me. Each picture is around 30 KiB, putting 15 in an email shouldn't be an issue.
So far I have been using most of the code from this post here with a few changes to match my file system.
Here's the code I'm using:
#!/bin/bash DATE=$(date +%F) MESSAGE="IMAGES" FILES=$(find /path/to/directory -not -newermt '-15 seconds' | sed 's/ /\\ /g' | grep ".jpg") if [ -z "$FILES" ]; then MBODY="No images were found that match search criteria." echo "$MBODY" | mutt -s "Data files for $TODAY" $EMAILS fi echo $MESSAGE | mutt -s "Images taken on $DATE" -a "$FILES" -- email@example.com
Spits out this error:
Can't stat /My/Directory/Image1.jpg /My/Directory/Image2.jpg: No such file or directory /My/Directory/Image3.jpg: unable to attach file.
Any help is greatly appreciated :). Thanks in advance