Public
Snippet #13 · created by Georg GH. Hopp ·

shell_syslog

shell_syslog.sh
#!/bin/sh

RUNDIR=/tmp

test -e "${RUNDIR}/logger.outpipe" && rm -Rf "${RUNDIR}/logger.outpipe"
test -e "${RUNDIR}/logger.errpipe" && rm -Rf "${RUNDIR}/logger.errpipe"
mkfifo "${RUNDIR}/logger.outpipe" "${RUNDIR}/logger.errpipe"
logger -s -p cron.info -t $(basename $0) <"${RUNDIR}/logger.outpipe"
logger -s -p cron.err -t $(basename $0) <"${RUNDIR}/logger.errpipe"
exec 1>"${RUNDIR}/logger.outpipe"
exec 2>"${RUNDIR}/logger.errpipe"
Please register or login to post a comment