on_motion_end not working
Question
Hi
I'm trying to get my motion run a script once the video file has been created.
I installed motion according to this: http://elinux.org/RPi-Cam-Web-Interface
My line in the motion.conf looks like this: on_movie_end /etc/motion/rsync.sh
Permissions are set to execute and the ownership was given to www-data, which is running the entire thing. I can run the script successfully as that user.
It works fine with on_picture_save, although it's running multiple instances of the script depending on the amount of pictures saved.
Cron is a bad idea because it might upload (what the script does) the movie when not done. I want the script to be run as soon as possible, because it's a surveillance camera. The script looks like this:
http://pastebin.com/4M8syX36
I couldn't get any debug logging to run so that I can see what happens when the script is executed. Hope you can help me out here!
Environment
Motion version: |
3.2.12-3.4 |
ffmpeg version: |
6:0.8.17-1+rpi1 |
Libraries: |
ffmpeg, mysql-common |
Server OS: |
Linux raspberrypi 4.0.6+ armv6l GNU/Linux |
--
FlyingPersian - 28 Jun 2015
Answer