How to configure to capture only at specified times of day
I would like to start the motion detection after a particular time of the day, say from 5pm until 7 am in the morning the next day. Is there a simple way to do this? I have searched in the FAQ and answered question sections and have not found anything related to capture times. Any help will be greatly appreciated.
| Motion version:
| ffmpeg version:
|| ffmpeg, mysql, postgresql
| Server OS:
|| Ubuntu 10.04
- 25 Jan 2012
How do I make time based motion settings?
You use a combination of the Motion remote control and the Linux cron daemon which all Linux
systems have. Let us take the example that we want to enable motion detection at 9:00 in the
morning and turn it off at 18:00. Motion 3.1 must be built with xmlrpc. If you use 3.2 Motion
is remote controlled using a browser.
In the file /etc/crontab we add these lines.
0 9 * * * root /usr/local/bin/motion-control detection resume
0 18 * * * root /usr/local/bin/motion-control detection pause
From motion 3.2 there is no longer a motion-control program. Instead you use a program that
can fetch a webpage. We simply just throw away the html page that Motion returns. Programs
commonly available on Linux machines are wget and lwp-request.
0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start
0 18 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/pause
Most Motion config options can be changed while Motion is running except options related to
the size of the captured images. So only your fantasy sets the limit to what you can change
combining cron and the remote control interface for Motion.