Re: test if script called by cron

2013-09-16 Thread aurfalien
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 r

Re: test if script called by cron

2013-09-16 Thread Polytropon
On Mon, 16 Sep 2013 23:28:17 -0400, kpn...@pobox.com wrote: > On Mon, Sep 16, 2013 at 02:05:04PM +0200, Polytropon wrote: > > On Mon, 16 Sep 2013 12:26:59 +0100, Paul Macdonald wrote: > > > Is there a simple way of testing whether a given script was called via > > > cron, > > > > > > I'd rather f

Re: test if script called by cron

2013-09-16 Thread Jerry
On Mon, 16 Sep 2013 12:26:59 +0100 Paul Macdonald articulated: > > 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. > > than

Re: test if script called by cron

2013-09-16 Thread Dan Nelson
In the last episode (Sep 16), Paul Macdonald said: > 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. You check to see if stdin is a ter

Re: test if script called by cron

2013-09-16 Thread Polytropon
On Mon, 16 Sep 2013 12:26:59 +0100, Paul Macdonald wrote: > 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. I'd suggest the script crea

test if script called by cron

2013-09-16 Thread Paul Macdonald
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