See below....

On Tue, Oct 22, 2013 at 1:17 PM,  <[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
It is always a good idea to add an absolute path, and if u consider
Jay's tips, the correct for every minute is:
* * * * *  /pathtopython/python /home/root/keep_alive.py >>
/home/root/cronjob.log
or if keep_alive.py is an executable simply
* * * * * cd /home/root/; keep_alive.py >> cronjob.log
or ....
> at some point I even added :
> SHELL=/bin/sh
Why not SHELL=/bin/bash
> and also :
>
> @reboot python /home/root/keep_alive.py >> cronjob.log
try
@reboot /home/root/keep_alive.py >>  /home/root/cronjob.log

> and because I saw it on the net as well I even tried specifying the user :
>
> @reboot root /home/root/keep_alive.py >> cronjob.log
@reboot root /home/root/keep_alive.py >> /home/root/cronjob.log
is the correct entry in /etc/crontab (and not the users crontab)



HTH....

-- 
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