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