Quite simply, starts and stops motion based on sunrise and sunset
Introduction
This is a simple script using Sunwait (Dan Risacher)
What does it do?
Starts motion at sunrise, and archives the previous day's images.
Stops motion at sunset.
Installation
You will need to download and compile "Sunwait"
http://www.risacher.org/sunwait/
Then, simply put these scripts anywhere you like on your machine, customize as needed.
Then, make 2 cron jobs. I have the start up job start 30 minutes before the earliest possible sunrise time for my area, and the shut down script 30 minutes before the earliest possible sunset time.
like this:
crontab -e
43 4 * * * /root/start_motion.sh >/dev/null 2>&1
0 16 * * * /root/stop_motion.sh >/dev/null 2>&1
Here are the scripts, remember, they are super simple, but you will need to modify them for your uses
#start_motion.sh
# use the lattitude and longitude for your location
sunwait civ up 41.000N 72.000W
tar -cf /var/www/www.example.com/webcam/`date '+%m.%d.%y'`.tar /var/www/www.example.com/webcam/*.jpg --remove-files
/usr/local/bin/motion
echo "motion is up" | mail -s "motion is up" jim@example.com
#stop_motion.sh
#use the lattitude and longitude for your location
sunwait civ down 41.000N 72.000W
killall -9 motion
echo "motion is down" | mail -s "motion is down" jim@example.com