0

I've installed motion mmal on raspberry pi and its recording video whenever I run startmotion script

     #!/bin/sh
     nohup /home/pi/mmal/motion -n -c /home/pi/mmal/motion-mmalcam.conf        1>/dev/null 2>&1 </dev/null &

However, Its making continous video until I stop motion.

I want to make a video of 5 minute after every 1 hour. I tried timeout command

     #!/bin/sh
    timeout 5m nohup /home/pi/mmal/motion -n -c /home/pi/mmal/motion-mmalcam.conf        1>/dev/null 2>&1 </dev/null &

How can i run this script after every 1 hour?

A.Mujeeb
  • 63
  • 10

1 Answers1

0

You can do it using crond: Enter: crontab -e

0 * * * * nohup /home/pi/mmal/motion -n -c /home/pi/mmal/motion-mmalcam.conf 1>/dev/null 2>&1 </dev/null &

5 * * * * pkill -9 motion

alnet
  • 1,093
  • 1
  • 12
  • 24