Put temporary output in ${TMPDIR:-/tmp}
If $<basedir>_output is not set, don't redirect output PR: 21395
This commit is contained in:
parent
8a7f44a640
commit
df470af5f8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66084
@ -66,8 +66,7 @@ the directory
|
|||||||
If this variable is set to an absolute path name, output is logged to
|
If this variable is set to an absolute path name, output is logged to
|
||||||
that file, otherwise it is taken as one or more space seperated email
|
that file, otherwise it is taken as one or more space seperated email
|
||||||
addresses and mailed to those users.
|
addresses and mailed to those users.
|
||||||
If this variable is not set, it defaults to
|
If this variable is not set or is empty, output is sent to standard output.
|
||||||
.Dq root .
|
|
||||||
.Pp
|
.Pp
|
||||||
For an unattended machine, suitable values for
|
For an unattended machine, suitable values for
|
||||||
.Ar $daily_output ,
|
.Ar $daily_output ,
|
||||||
|
@ -127,14 +127,13 @@ output.
|
|||||||
If the
|
If the
|
||||||
.Va <basedir>_output
|
.Va <basedir>_output
|
||||||
value does not begin with a
|
value does not begin with a
|
||||||
.Dq / ,
|
.Dq /
|
||||||
it is assumed to contain a list of email addresses, and the output is
|
and is not empty, it is assumed to contain a list of email addresses, and
|
||||||
mailed to them.
|
the output is mailed to them.
|
||||||
.Pp
|
.Pp
|
||||||
If
|
If
|
||||||
.Va <basedir>_output
|
.Va <basedir>_output
|
||||||
is not set, it defaults to
|
is not set or is empty, output is sent to standard output.
|
||||||
.Dq root .
|
|
||||||
.Sh ENVIRONMENT
|
.Sh ENVIRONMENT
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
|
@ -27,7 +27,7 @@ fi
|
|||||||
|
|
||||||
host=`hostname`
|
host=`hostname`
|
||||||
export host
|
export host
|
||||||
tmp_output=/var/run/periodic.$$
|
tmp_output=${TMPDIR:-/tmp}/periodic.$$
|
||||||
|
|
||||||
# Execute each executable file in the directory list. If the x bit is not
|
# Execute each executable file in the directory list. If the x bit is not
|
||||||
# set, assume the user didn't really want us to muck with it (it's a
|
# set, assume the user didn't really want us to muck with it (it's a
|
||||||
@ -39,7 +39,8 @@ do
|
|||||||
eval output=\$${arg##*/}_output
|
eval output=\$${arg##*/}_output
|
||||||
case "$output" in
|
case "$output" in
|
||||||
/*) pipe="cat >>$output";;
|
/*) pipe="cat >>$output";;
|
||||||
*) pipe="mail -s '$host ${arg##*/} run output' ${output:-root}";;
|
"") pipe=cat
|
||||||
|
*) pipe="mail -s '$host ${arg##*/} run output' $output";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
success=YES info=YES badconfig=NO # Defaults when ${run}_* aren't YES/NO
|
success=YES info=YES badconfig=NO # Defaults when ${run}_* aren't YES/NO
|
||||||
|
Loading…
Reference in New Issue
Block a user