test if script called by cron

aurfalien aurfalien at gmail.com
Tue Sep 17 03:55:52 UTC 2013


An easy way to do this is check /var/log/cron

There are many other ways. 

- aurf

On Sep 16, 2013, at 4:26 AM, Paul Macdonald wrote:

> 
> Hi,
> 
> Is there a simple way of testing whether a given script was called via cron,
> 
> I'd rather find a solution that would work from within the script rather than setting an environment variable in the crontab.
> 
> thanks
> Paul.
> 
> (anyone here going to EuroBSD con?)
> 
> -- 
> -------------------------
> Paul Macdonald
> IFDNRG Ltd
> Web and video hosting
> -------------------------
> t: 0131 5548070
> m: 07970339546
> e: paul at ifdnrg.com
> w: http://www.ifdnrg.com
> -------------------------
> IFDNRG
> 40 Maritime Street
> Edinburgh
> EH6 6SA
> ----------------------------------------------------
> High Specification Dedicated Servers from £100.00pm
> ----------------------------------------------------
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list