Send Output errors of nohup to syslog

bash, nohup, rsyslog

Solution

A way in `bash` to redirect output to syslog is:

exec > >(logger -t myscript)

`stdout` is then sent to `logger` command

exec 2> >(logger -t myscript)

for `stderr`

Problem

I'm attempting to write a bash script that uses nohup and passes errors to rsyslog. I've tried this command with different variations of the log variable (see below) but can't get the output passed to anything but a std txt file. I can't get it to pipe. ``` nohup imageprocessor.sh > "$LOG" & ``` Is it possible to pipe nohup output or do I need a different command. A couple of variations of log that I have tried ``` LOG="|/usr/bin/logger -t workspaceworker -p LOCAL5.info &2" ``` or ``` LOG="|logtosyslog.sh" ``` or ``` LOG="logtosyslog.sh" ```

Original source