title: Stop / Kill a Python script using cron
body: <p>My goal is to run my python script each day (besides Friday and Saturday) at 10:00 and terminate it by 18:00.</p>
  
  <p>I added the following to the crontab but the second command isn't working.</p>
  
  <pre><code>0 10 * * 0,1,2,3,4 /home/pi/MotionDetector.py
  0 18 * * 0,1,2,3,4 /home/pi/MotionDetector.py killall -9 MotionDetector.py 
  </code></pre>
  
  <p>Using Linux 2.7.9</p>
  
  <p>I tried <a href="https://serverfault.com/questions/797057/how-to-kill-all-python-processes-except-one-from-bash">this</a> solution that worked Via the terminal but not in cron (when I typed the command in the terminal it closed the script right away but when I put it on the crontab it didn't do anything)</p>