how does motion pass an argument to a script in on_picture_save
Question
I made a script to send pictures captured by motion to another machine through ftp. Normally the command line argument is called $1 in the script. When I run the script below from the command line it works. But when this script is called by motion's on_picture_save it doesn't. How should I change the script?
The script looks like this:
#!/bin/bash
ftp www.mysite.com << ftpinput
put $1
ftpinput
Environment
Motion version: |
3.2.3 |
ffmpeg version: |
|
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
|
--
HeinVandenacker - 06 Nov 2005
Follow up
Which
exact version do you run? Is it 3.2.3? Or is it the latest 3.2.4_snap4?
--
KennethLavrsen - 06 Nov 2005
I'm running version 3.2.3-1 from the download page.
--
HeinVandenacker - 06 Nov 2005
Answer
The on_picture_save appends the filename to the command. So in principle the $1 method should work. I cannot say why it does not.
Note that from Motion 3.2.4_snap4 you have to put a %f after the on_picture_save command. This is changed so that you can write more advanced commands where the filename is in the middle of the command. But with 3.2.3 the filename is appended.
--
KennethLavrsen - 07 Nov 2005