Java – Put CPU % into a local file by Cron job No.81
How to save the current CPU % on Ubuntu into a local file by Cron job with an execution of Jar is shown in this blog. ▼1. How to export the current CPU % on Ubuntu The command “top -b -n 1” is executed by Java and save only CPU % into a file. ▼2. Prerequisites This blog is based on Java – Capture CPU,Memory,Network info on Ubuntu No.79. ▼3. Java code to export the current CPU % on Ubuntu 3-1. Develop perfch2.java “perfch2.java” run the command “top -b -n 1” and save only CPU % into a file by Java. the file name of output is CPU{epochmilliseconds}.txt when file … Continue reading “Java – Put CPU % into a local file by Cron job No.81”