From: John S. <joh...@gm...> - 2007-04-22 02:03:11
|
OK, if you wait long enough I will answer my own question. So, it should have been obvious, but the samples I was lookging at must have been missing something, but now it works: on_movie_end /usr/local/etc/mail_file.sh %f sends me the avi file after it is done. Now, how can I get the avi files to stop playing like they are at double speed? Thanks, John On 4/21/07, John Sutherland <joh...@gm...> wrote: > > I am trying this.....but no luck, no notification....not e-mail > attachment. I did get notification when the .jpg's were created, so I know > the process works. But I do not need 100 e-mails telling me motion was > detected, I want the file after it was detected. > > Anybody alread done this? > > Here is what I have: > > # Command to be executed when a movie file (.mpg|.avi) is closed. (default: none) > # To give the filename as an argument to a command append it with %f > > on_movie_end /usr/local/etc/mail_motion.sh %f > on_movie_end /usr/local/etc/mail_file.sh > =========================== > mail_motion.sh > =================================== > #!/bin/sh > > # Motion sample script to send an e-mail at start of an event. > > # Replaces the former 'mail' option. > # Just define this script as 'on_event_start'-script in motion.conf like that: > # on_event_start send_mail "%Y-%m-%d %T" > > #change to suit your needs: > > #location of 'mail' binary > MAIL="/bin/mail" > #Destination e-mail address > TO="joh...@gm..." > #Subject of the e-mail > > SUBJECT="Motion detected" > > #Don't change anything below this line > echo -e "This is an automated message generated by motion.\n\nMotion detected: $1\n\n" | $MAIL -s "$SUBJECT" $TO > > > =================== > mail_file.sh > =================== > #!/bin/sh > > # Motion sample script to send an e-mail at start of an event. > # Replaces the former 'mail' option. > # Just define this script as 'on_event_start'-script in motion.conf like > that: > # on_event_start mail_file.sh "%Y-%m-%d %T" > > mutt -a $1 -s 'motion capture' joh...@gm... < '.' > > > > On 4/21/07, John Sutherland <joh...@gm...> wrote: > > > Rob, > > > > Thanks, actually I got it working....guess I needed sendmail service to > > be running! Oooops! How embarassing. > > > > Now.....how do I attach a file to an e-mail from the command line? Is > > that possible? I am trying to avoid FTP....security reasons, don't want to > > put my userid and password out there in the clear. I could do SFTP, but it > > prompts for a password, I could create a pair of keys, make the private key > > with no password......but I want to attach a file with an e-mail if I can. > > > > Thanks, > > > > John > > > > On 4/21/07, Rob MacGregor < rob...@gm...> wrote: > > > > > > On 4/21/07, John Sutherland <joh...@gm...> wrote: > > > > I have tried to use the sample mail script, but it is not > > > working. I am not > > > > sure how to trouble shoot, but I read that from the command line > > > /bin/mail > > > > expects a Ctrl-D to close and send the e-mail. How does that happen > > > from > > > > the sample here? > > > > > > <CTRL>D just sends (usually) EOF (End Of File), which happens > > > automatically when you use a pipe ('|' symbol) as shown in the sample > > > script. > > > > > > For troubleshooting you may want to look at your system's mail log > > > (most likely either /var/log/maillog or a number of files under > > > /var/log/mail/). Keep in mind that mail transfer isn't usually > > > instant and depending on how your local MTA is configured it may > > > either be a few seconds, a few tens of seconds or many minutes between > > > (mail) queue processing. > > > > > > -- > > > Please keep list traffic on the list. > > > > > > Rob MacGregor > > > Whoever fights monsters should see to it that in the process he > > > doesn't become a monster. Friedrich Nietzsche > > > > > > ------------------------------------------------------------------------- > > > > > > This SF.net email is sponsored by DB2 Express > > > Download DB2 Express C - the FREE version of DB2 express and take > > > control of your XML. No limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > _______________________________________________ > > > Motion-user mailing list > > > Mot...@li... > > > https://lists.sourceforge.net/lists/listinfo/motion-user > > > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Motion-user mailing list > > Mot...@li... > > https://lists.sourceforge.net/lists/listinfo/motion-user > > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > > > > > |