Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Dec 2013 14:10:03 GMT
From:      Patrick Dung <patrick_dkt@yahoo.com.hk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/184409: crontab enviornment should include common paths like /sbin or /usr/sbin
Message-ID:  <201312011410.rB1EA3nQ009303@oldred.freebsd.org>
Resent-Message-ID: <201312011420.rB1EK0pn036678@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         184409
>Category:       misc
>Synopsis:       crontab enviornment should include common paths like /sbin or /usr/sbin
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 01 14:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Patrick Dung
>Release:        FreeBSD 9.2 x64
>Organization:
>Environment:
>Description:
By default, user's crontab would have below environment variables 

LOGNAME=user1
PATH=/usr/bin:/bin
PWD=/usr/home/user1
HOME=/home/user1
USER=user1
SHELL=/bin/sh

When the script is invoked/test in command line, it worked.
When the script is invoked by cronjob, some part of the script failed to run because /usr/sbin/chown is not in the search PATH.

It is not convenient.
>How-To-Repeat:
always
>Fix:
configure user's crontab to include PATH like /etc/crontab

PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312011410.rB1EA3nQ009303>