Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jun 2015 14:33:57 -0700
From:      Chris Wojo <polishdev@tech-wolf.net>
To:        Craig Rodrigues <rodrigc@FreeBSD.org>
Cc:        "Robert Simmons" <rsimmons0@gmail.com>,  <freebsd-python@freebsd.org>
Subject:   Re: Re: Python Subprocess Crontab Problem
Message-ID:  <14ddf64d80d.1020c3e5a171271.8900665107577587389@tech-wolf.net>
In-Reply-To: <CAG=rPVdkzy%2BK1KV2AP4O-j-4UqoPz5pLrQX7u9NJkEuuqQ5eqA@mail.gmail.com>
References:  <CA%2BQLa9BjC=M-5wxA0gzoTJO1xHL9XbhpTN10QhhrdCG9bxf3Lg@mail.gmail.com> <CAG=rPVdkzy%2BK1KV2AP4O-j-4UqoPz5pLrQX7u9NJkEuuqQ5eqA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
crontab isn't using a PATH for your specified user, so you need to give an absolute path.

---- On Wed, 10 Jun 2015 14:02:06 -0700 Craig Rodrigues &lt;rodrigc@FreeBSD.org&gt; wrote ---- 

On Wed, Jun 10 
 
&gt; Here is how I'm calling the script in crontab: 
&gt; PATH=$PATH:/usr/local/bin 
&gt; 
 
I can't remember offhand, but I don't think you can do that. 
I think you may need to fully specify the PATH instead of using $PATH. 
 
 
 
&gt; errors = open('/home/myuser/error', 'wb') 
&gt; 
&gt; with tempfile.TemporaryDirectory() as tmpdirname: 
&gt; tempthing = os.path.join(tmpdirname, thing) 
&gt; fh = open(tempthing, 'wb') 
&gt; fh.write(b'123') 
&gt; fh.close() 
&gt; zipname = '{}.zip'.format(thing) 
&gt; ziptempfile = os.path.join(tmpdirname, zipname) 
&gt; 
 
Can you add right here: 
 print("PATH: %s" % os.environ['PATH'], file=errors) 
 
and see what the PATH is in your errors file? 
 
-- 
Craig 
_______________________________________________ 
freebsd-python@freebsd.org mailing list 
http://lists.freebsd.org/mailman/listinfo/freebsd-python 
To unsubscribe, send any mail to "freebsd-python-unsubscribe@freebsd.org" 







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14ddf64d80d.1020c3e5a171271.8900665107577587389>