Question : Make a script that sends files with FTP?

I have an application (motion, an app that saves images from an usb web-camera upon motion detection) that writes .jpg and .swf-files to a directory /media/usb0.

I need those files to be sent with email tom me  when they are created. I think I need a script that does this and is working in the background. I also think that its a good idea that the scripts moves each file to another directory after being sent (like /media/usb0/sent) so that the input-directory that is being monitored by the script is always empty.

The system is running linux:


sheevaplug-debian:/media/usb0# uname -a
Linux sheevaplug-debian 2.6.32-00007-g56678ec #1 PREEMPT Mon Feb 8 03:49:55 PST 2010 armv5tel GNU/Linux


I have no scripting-knowledges myself. Can someone help me create a script that does this?

Br Jimmy

Answer : Make a script that sends files with FTP?

If you have mutt installed, you can use mutt
The command will be:
echo "message body" | mutt -s "Subject of the message" -a %f recipient_email_address

One cautionary note, make sure the mailbox you have can handle the amount of data that will be sent as well as that your provider allows for the possibly large mail messages to come through.
i.e. if you send a 2MB email, will it get through? 5, 10, 15, 20MB or larger?
An alternative might be that the email not include the file, but just be an alert that a detected/triggered recording occurred.  If you have a web server on the system you could then use a web browser to access and view the recorded data.
Random Solutions  
 
programming4us programming4us