I've got a third-party Python script to run in background using nohup. And instead of piping the output to a file I'd like the output to be appended to the system log using logger. Added to that I need the error output to be logged using the priority "user.error" and the regular output "user.notice". This way I'm sure at least the errors pop up in the logs.
Running a simple command w/o nohup seems to work:
ls /tmp 1> >(logger --priority user.notice --tag myTag) 2> >(logger --priority user.error --tag myTag)
Running this /w nohup however yields unexpected results
nohup sh -c ls /tmp 1> >(logger --priority user.notice --tag myTag) 2> >(logger --priority user.error --tag myTag) &
The log will contain "nohup: ignoring input" and sometimes even empty entries.
Can somebody help me to write this command properly ?