In CentOS 8, we created a shell script that records the results of the top command in a log file every 10 seconds.
This script has been set to start the service on systemctl.The service configuration file is as follows:
As a result, the output process name of the top command is shortened and recorded in the log file.
For example, the original content was:
If you start with systemctl, the process name is only halfway and the rest is the "+" symbol as follows:
There is no problem if you run the script manually on the terminal.
Running from systemctl seems to shorten it.
Why is this?
Would it be possible to make everything come out without shortening it?
Thank you for your cooperation.linux centos shellscript systemd
I'm a questioner, but I solved it after receiving your comment.
-w512to the top command. (Process names are no longer shortened.)
Note: Without the use of this command-line option, output width is always based on the terminal at which top was invoked either or not in Batch mode.
Thank you @metropolis and @cubick.
© 2022 OneMinuteCode. All rights reserved.