From owner-freebsd-python@FreeBSD.ORG Wed Jun 10 21:34:07 2015 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD58F5D1 for ; Wed, 10 Jun 2015 21:34:07 +0000 (UTC) (envelope-from polishdev@tech-wolf.net) Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7EB51974 for ; Wed, 10 Jun 2015 21:34:06 +0000 (UTC) (envelope-from polishdev@tech-wolf.net) Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1433972037695235.28157602929798; Wed, 10 Jun 2015 14:33:57 -0700 (PDT) Date: Wed, 10 Jun 2015 14:33:57 -0700 From: Chris Wojo To: Craig Rodrigues Cc: "Robert Simmons" , Message-ID: <14ddf64d80d.1020c3e5a171271.8900665107577587389@tech-wolf.net> In-Reply-To: References: Subject: Re: Re: Python Subprocess Crontab Problem MIME-Version: 1.0 X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2015 21:34:08 -0000 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 <rodrigc@FreeBSD.org> wrote ---- On Wed, Jun 10 > Here is how I'm calling the script in crontab: > PATH=$PATH:/usr/local/bin > 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. > errors = open('/home/myuser/error', 'wb') > > with tempfile.TemporaryDirectory() as tmpdirname: > tempthing = os.path.join(tmpdirname, thing) > fh = open(tempthing, 'wb') > fh.write(b'123') > fh.close() > zipname = '{}.zip'.format(thing) > ziptempfile = os.path.join(tmpdirname, zipname) > 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"