Any thoughts on the incorrect syntax here?  

 Command to be executed when a motion frame is detected (default: none)
on_motion_detected /home/pi/motion.sh %v-%Y%m%d%H%M%S-%q

 Command to be executed when a motion frame is detected (default: none)
on_motion_detected /home/pi/motion.sh %v-%Y%m%d%H%M%S-%q

Images do capture but the script is never executed (eventually, assuming I can get the filename just right, I'm going to have this script launch an expect script to transfer the file to the central server.

Greg


On Sun, Jul 21, 2013 at 5:17 AM, Dougie Nisbet <dougie@highmoor.co.uk> wrote:
I don't think you can do it directly but there are a few options that might achieve what you want. I call a short script when motion is detected on my raspberry pi, which in turn runs rsync to copy files to another server. I used to use:

# Command to be executed when a motion frame is detected (default: none)
; on_motion_detected <myscript>

but this often resulted in multiple rsync processes. Then I discovered I could use:

# Command to be executed when an event ends after a period of no motion
# (default: none). The period of no motion is defined by option gap.
on_event_end /home/dougie/bin/motion_detected > /home/dougie/logs/motion_detected.out 2>&1

which does exactly what I need.

In my 'motion_detected' script I have the following two lines:
   
    rsync --ignore-existing -ruv /home/dougie/webcam/ phoenix:/diskb/webcams/pi1
    ssh phoenix album -geometry=320x180 -sort=date -reverse_sort /diskb/webcams/pi1/$(date +%Y)/$(date +%m)/$(date +%d

(the second line has nothing to do with motion - it's just a neat way of always having quick access to all my webcam images anywhere on my homelan).

You'd have the issue that you'd still have a local copy of the images on your source machine - in my case the rpi. I tend to housekeep this quite aggressively, clearing out all images more than a day old using find in a cron job. I deliberately don't use '--delete' in my rsync so that 'phoenix' keeps an archive of images that I can housekeep as necessary.

Dougie


On 21/07/13 08:40, october8134 wrote:
Hello all,
Is there a way to specify a network location for "target_dir"?  I don't want to save the image to a drive connected to the PC.  I want to connect to a drive that's on the network...something like "192.168.1.7/storage/webcam"

I just joined the list.  Please excuse me for any mailing list etiquette violations.  I'm much more familiar with forums than mailing lists.

Thanks!
J




------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk


_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user
http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user
http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome