[TriLUG] bash script, motion, scp

Scott Lambdin lopaki at gmail.com
Fri Jan 11 11:46:13 EST 2008


Hmm - it looks like some version put the filename at the end without %f  -
see what $2 is in your bash script.

On 1/11/08, James Tuttle <jjtuttle at trilug.org> wrote:
>
> Hi,
>
> I'm working on my motion configuration.  Motion allows an
> on_picture_save option.  Many people use wput to ftp the picture to a
> remote server, but I couldn't get that to work and I don't care for
> plain text authentication.
>
> I'd like to use scp.  In my motion.conf file I have this line:
> on_picture_save /home/jjtuttle/.motion/onsave.sh %f
> %f should expand to the to filename of the saved picture.
>
> My onsave.sh file reads thusly:
> #/bin/bash
>
> scp $1 jim at bt:~/www/private/motion/.
> echo "SCP'd $1 to bt"
>
> However, the %f doesn't seem to be expanding.  I get this error:
> [1] File of type 2 saved to:
> /home/jim/Documents/personal/motion/01-20080111110000-snapshot.jpg
> %f: No such file or directory
> SCP'd %f to Braggtown
>
> So, my question is, how can I use SCP to save this picture to a remote
> location.  I suppose I could trigger a script that finds the most recent
> image in the directory and SCP's that, but during a motion capture
> event pictures are saved pretty quickly and I wonder if I'd miss some.
>
> Any ideas?
>
> Thanks,
> Jim
> --
> --
> ---Jim Tuttle
> ------------------------------------------------------
> http://www.braggtown.com
> PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x69B69B08
>
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>



More information about the TriLUG mailing list