Motion - Support Question 2005x 11x 06x 141113

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
Topic revision: r4 - 07 Nov 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.