First created: 15th May 2011, 14:51 PT, AD Last updated: 12th September 2011, 18:50 PT, AD Ubuntu "motion" *************** See emails 16th April 2011 (some links have more info) Just install from Synaptic Package manager login as root from a terminal type: motion note - if you did not set up the motion config file as explained in the link below, then a default setup is executed, saving photos triggered by motion to /home/anne/ if the .jpg files from /home/anne/ are copied to /var/www then they are on the internet http://ubuntuforums.org/showthread.php?t=1648738 I could create a batch file to move (mv) *.jpg from /home/anne/ to /var/www and set a schedule on the batch file http://ubuntuforums.org/showthread.php?t=1648738 what I found if you use the default settings, thousands of .jpg files end up in /home/anne/ almost continuously from motion triggered events detected by Logitech orbit camera - Ubuntu 10.04 server detected the camera seamlessly. Cheese worked on server with orbit. Installed motion. the config file for motion needs to be tweaked to get what you need - i.e. short video instead of thousands of .jpg files I did as was instructed in the page above except #8 and I ran as root using the command: motion (not motion -n) everything worked! for every motion a .swf file (movie) is produced **************************************************** How I used cron and crontab to schedule tasks on ubuntu linux... **************************************************** this is what I did: and it works fine - Plugged in logitech orbit webcam to server and autodetect worked fine "motion" is running on the server any motion detected by motion triggers creation of .jpg and .swf files to: /home/anne/motion_videos I also wrote a batch file to be executed by cron: copy_movies_var_www_webcam.sh made the above file executable for everybody. The following 2 lines are the contents of /home/anne/motion_videos/copy_movies_var_www_webcam.sh cd /home/anne/motion_videos cp -n *.swf /var/www/webcam/movies cp -n *.jpg /var/www/webcam/photos So the above file is executed every minute as controlled by cron and crontab, see below... The -n flag means that existing files are NOT overwritten. contents of /etc/crontab: # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) # * * * * * root /home/anne/motion_videos/copy_movies_var_www_webcam.sh COMMENT OUT THE ABOVE LINE TO AVOID GETTING MULTIPLE EMAILS FROM CRONTAB RE PERMISSION IS NOT CORRECT FOR WRITE OPERATION The last line is my addition to the original crontab and essentially it states every minute in every hour in every day copy all new movies to the Internet folder /var/www/webcam Most of the time I'm logged in as root setting things up. See emails: 16th April 2011 see 2 attached documents to email 15th May 2011 one for my doc of my 2008 attempt to install motion on the server, the other the manual (man) entry for motion. References: http://www.unixgeeks.org/security/newbie/unix/cron-1.html http://all4wp.blogspot.com/2008/03/cron-for-dummies.html http://infectedproject.wordpress.com/2007/06/26/set-up-a-webcam-security-system/ command line $ motion http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideGettingItRunning#Important_Definitions http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome motion and motion.conf http://www.linux.com/archive/feature/114118 http://fixx.co.za/?p=201 (emails Sunday 15th May) 16th April 2011, in the holidays, did the above. ******************************************************************* This I discovered in Dec 2008 at first attempt to run motion: ******************************************************************* ******************************************************************* To stop motion running, you need to find the process ID as follows: ******************************************************************* this is all explained here: http://www.lavrsen.dk/twiki/bin/view/Motion/SignalsKill anne@server:/tmp$ ps -ef | grep motion anne 5246 5226 1 12:52 pts/0 00:01:25 motion -s anne 8556 8516 0 14:02 pts/3 00:00:00 view motion.conf anne 10417 5386 0 14:39 pts/1 00:00:00 grep motion anne@server:/tmp$ kill -s SIGTERM 5246 anne@server:/tmp$ this is then what happened in /home/anne (where the motion -s command originated) [1] Changes: 0 - noise level: 12 [1] End of event 17 [1] Thread exiting [1] Threads finished [1] Motion terminating anne@server:~$ ls this is all explained here: http://www.lavrsen.dk/twiki/bin/view/Motion/SignalsKill