Lines Matching +full:- +full:- +full:arg +full:- +full:file
1 #!/bin/sh -
6 # usage: periodic { daily | weekly | monthly | security } - run standard scripts
7 # periodic /absolute/path/to/directory - run periodic scripts in dir
23 *) pipe="mail -E -s '$host ${2}${2:+ }${1##*/} run output' $output";;
28 if [ $# -lt 1 ] ; then
32 # If possible, check the global system configuration file,
34 if [ -r /etc/defaults/periodic.conf ]; then
46 # If we were called normally, then create a lock file for each argument
53 for arg; do
54 lockfile=/var/run/periodic.${arg##*/}.lock
55 lockf -s -t 0 "${lockfile}" /bin/sh $0 LOCKED "$arg"
60 output_pipe $arg "$PERIODIC"
64 echo "$host ${arg##*/} prior run still in progress" | \
65 output_pipe $arg "$PERIODIC"
76 if [ $# -ne 2 ]; then
80 arg=$1
82 if [ -z "$PERIODIC_ANTICONGESTION_FILE" ] ; then
83 export PERIODIC_ANTICONGESTION_FILE=`mktemp ${TMPDIR:-/tmp}/periodic.anticongestion.XXXXXXXXXX`
86 # We might be in a recursive invocation; let the top-level invocation
87 # remove the file.
90 if [ -t 0 ]; then
93 tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX`
95 export PERIODIC="$arg${PERIODIC:+ }${PERIODIC}"
97 # Execute each executable file in the directory list. If the x bit is not
99 # README file or has been disabled).
103 case $(eval echo "\$${arg##*/}_show_$var") in
109 case $arg in
110 /*) if [ -d "$arg" ]; then
111 dirlist="$arg"
113 echo "$0: $arg not found" >&2
119 [ -d $top/$arg ] && dirlist="$dirlist $top/$arg"
128 for file in $dir/*; do
129 if [ -x $file -a ! -d $file ]; then
132 $file </dev/null >$tmp_output 2>&1
134 if [ -s $tmp_output ]; then
149 echo "No output from the $processed file$plural processed"
153 echo "-- End of $arg output --"
155 } | output_pipe $arg "$context"
157 rm -f $tmp_output
159 rm -f $PERIODIC_ANTICONGESTION_FILE