Motion - Support Question 2009x 08x 21x 164243

Have motion run only at certain times.

Question

How can i get motion to only record during certain hours? I only want it to run from 10:00 PM to 8:00 pm. I tried searching but no luck.

Paste in your error messages, config settings, terminal window output etc in this text field.

Environment

Motion version: 3.2.11.1
ffmpeg version: libavutil version: 49.0.0 libavcodec version: 51.7.0 libavformat version: 50.3.0
Libraries: ffmpeg, mysql, postgresql
Server OS: Ubuntu 9

-- CityEats - 21 Aug 2009

Answer

- Quick and dirty solution : in your crontab file, (crontab -e) insert these 2 lines :

00 22 * * * /usr/local/bin/motion

00 20 * * * /usr/local/bin/stop_motion.sh

(you solely requested : I only want it to run from 10:00 PM to 8:00 pm, aka 22 hours per day...)

- stop_motion.sh is a shell script with these content :

#!/bin/bash

killall motion

killall motion

killall motion

-- FlorinAnton - 21 Aug 2009

stop_motion.sh is a shell script and should therefore be in the bin directory not the etc.

You will need to set the permissions on stop_motion.sh by using the following

chmod a+x /usr/local/bin/stop_motion.sh

-- SpencerMarshall - 29 Apr 2010
Topic revision: r4 - 02 May 2010, AngelCarpintero
Copyright © 1999-2017 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.