[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
On Mon, 2005-06-27 at 18:10 -0400, Michael Still wrote:
> How about setting an environment variable like RUNNING_FROM_CRON=true
> in your crontab and checking it in the script? I don't remember the
> specifics of the environment from cron though, but I think if you set
> it in cron or on the cron command line (like 45 * * * 7 root
> RUNNING_FROM_CRON=true; /my/command) then it'll be in the process
> environment.
>
> On 6/27/05, Christopher Bergeron <christopher at bergeron.com> wrote:
> > Does anyone know of an easy way for my script to determine if it's being
> > run from cron or from a user shell?
> >
> > I have a feeling theres an easy way to do this, but I'm drawing a
> > complete blank right now. I'm looking at my Environment vars, but I'm
> > not sure what gets set by Cron when it runs a script.
> >
> > Any ideas are much appreciated...
> >
> > Kind regards,
> > CB
> >
> >
> > _______________________________________________
> > Ale mailing list
> > Ale at ale.org
> > <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
> >
>
>
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00752" href="msg00752.html">[ale] block dev over net?</a></strong>
<ul><li><em>From:</em> dcorbin at machturtle.com (David Corbin)</li></ul></li>
<li><strong><a name="00753" href="msg00753.html">[ale] block dev over net?</a></strong>
<ul><li><em>From:</em> jjj863 at gmail.com (Jerry Yu)</li></ul></li>
<li><strong><a name="00777" href="msg00777.html">[ale] block dev over net?</a></strong>
<ul><li><em>From:</em> dcorbin at machturtle.com (David Corbin)</li></ul></li>
<li><strong><a name="00782" href="msg00782.html">[ale] block dev over net?</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
<li><strong><a name="00783" href="msg00783.html">[ale] Bash: How to determine if called from cron?</a></strong>
<ul><li><em>From:</em> christopher at bergeron.com (Christopher Bergeron)</li></ul></li>
<li><strong><a name="00811" href="msg00811.html">[ale] Bash: How to determine if called from cron?</a></strong>
<ul><li><em>From:</em> stillwaxin at gmail.com (Michael Still)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00811.html">[ale] Bash: How to determine if called from cron?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00813.html">[ale] Ubuntu mouse woes ...</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00811.html">[ale] Bash: How to determine if called from cron?</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00756.html">[ale] SOHO Proxy - Questions</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00812"><strong>Date</strong></a></li>
<li><a href="threads.html#00812"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>