Greetings,

On Tue, 22 Oct 2013, [email protected] wrote:

Hello everyone,
I need to have a python script running every minute to send a heartbeat
broadcast.
I have developed this sript and it works just fine when I start it from the
shell.
Next step was to actually add it to the cron list.
So I have been looking on the net and I saw that should be possible by
using crontab -e.
So that's what I've done, resulting in the following :

30 * * * *    /usr/bin/ntpdate-sync silent
1 * * * *    python /home/root/keep_alive.py >>cronjob.log

The first line in your crontab runs once per hour at 30 minutes past the top of the hour. The second line also runs once per hour, but runs 1 minute past the top of the hour. *NOT* once every minute as you desired.


Crond runs *only* once every minute (finest resolution possible), so if you want a cron job to run once every minute, then you need to set the fields as follows:

   * * * * *  /home/root/keep_alive.py >> cronjob.log


And check to make certain that your script actually resides in the directory path you have given (/home/root/). The 'root' account's home directory is /root, not /home/root, so to have /home/root you must have performed a mkdir to create that root subdirectory under /home. Also be aware that plain old users CANNOT run scripts that require 'root' permissions. They must be run out of the system crontab configured in /etc/crontab.

Also verify that the permissions are set correctly on your python script so that it is executable. 'ls -al keep_alive.py' will show the permissions. 'chmod u+x keep_alive.py' will turn on the execute bit for this file to be run as the User.

   Hope this helps!

      --- Jay Nugent  WB8TKL
          UNIX/Linux System Administration instructor
          Washtenaw Community College - Ann Arbor, Michigan

--
For more options, visit http://beagleboard.org/discuss
--- You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to