I’ve a reasonably easy script written for calculating heap dimension and it makes use of ./jmap. The script first finds the method id and saves it in a variable – PID. The identical PID is given as a variable within the script as follows:
$JAVA_BIN./jmap -heap $(cat $PID) > take a look at.txt
When script is run manually, it really works wonderful. And as an alternative of variable if I immediately give pid as quantity within the above command, even the cronjob runs efficiently, but when I give it like above, the cronjob outputs the person worth of jmap as output for take a look at.txt:
(to connect with working course of)
(to connect with a core file)
jmap [option] [server_id@]
(to connect with distant debug server)
It is prefer it’s not in a position to learn the PID worth from the variable.
I’m working crontab -e
I’m working LINUX RHEL 6
Any ideas on the best way to repair this?