Need bash script for CPU load logging to file

bash

(richard.llom) #1

Hi,
I want to debug this ksysguard issue 304145.

My idea is to log the raw output of /sys/devices/system/cpu/cpuX/load to a file and see whats in there when the bug occurs.

However I’m not good at shell scripting so I was wondering if someone could help me out here… :sweat_smile:

Requirements:

  • Log output of cpu/load into one file (in my case cpu0, cpu1, cpu2, cpu3)
  • must use the same sysfs source as ksysguard is using
  • logging intervall 0,5 secs
  • must handle all kind of input (negative numbers, text, …?)

TIA :grinning: