Send check-job stdout and stderr to the journal with identifier nightly-check.
Which command is appropriate?
systemd-cat runs a command and connects its output to the journal; -t sets the identifier.
Detailed explanation
logger -f nightly-check check-jobIncorrect. -f reads a file and does not wrap a command's streams.
Incorrect. -f reads a file and does not wrap a command's streams.
systemd-cat -t nightly-check check-jobCorrect. systemd-cat runs check-job and tags its output.
Correct. systemd-cat runs check-job and tags its output.
journalctl -t nightly-check check-jobIncorrect. journalctl reads existing entries; it does not execute the command.
Incorrect. journalctl reads existing entries; it does not execute the command.
rsyslogd -t nightly-check check-jobIncorrect. rsyslogd is a daemon, not an output wrapper.
Incorrect. rsyslogd is a daemon, not an output wrapper.
Try it yourself
An example you can run in a temporary verification environment.
systemd-cat --help 2>&1 | grep -E -- '--identifier| -t' | head -n 1Expected result
-tまたは--identifierのhelp行Key points
- systemd-cat sends to journal
- -t is identifier
- Search with journalctl -t
Notes
- Environment: systemd-cat helpの読取のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.