yvonnezoe
Posts: 127
Joined: Thu Feb 14, 2013 2:10 am
Contact: Website

Any idea on cron job?

Fri Mar 28, 2014 1:36 pm

Hi! I would like to improve on my project by using cron jobs.
Currently, i have a web application that allows me to control servos. However I would like to add another function on the web application where i can set the cron job to execute a script that would control the servos automatically. meaning that i can click on a button on the web specifying that i'm not at home or something and that would tell cron job to take over.

Any idea how can i do this? A link or tutorial would be good too. :)
Just started my Raspberry Pi journey >> http://yvonnezoe.wordpress.com

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Any idea on cron job?

Fri Mar 28, 2014 1:44 pm

One way would be to have the cron script check for the presence of a file like /DOCUMENT_ROOT/gone_away and if it is there, then run your servo program. Run the script from cron as often as you need. To create the file, touch would work.

There are a dozen different ways to do what you want. What I described is what I would do.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

Return to “Beginners”