find out what is using my CPU while I'm not in front of a console

toxic

Active Member
Aug 1, 2020
60
8
28
38
Hello,
I know it's probably nothing specific to proxmox but I'll try asking anyway :
Every day from 4 to 5am there is something running on my system, making it hot, and I don't know what it is...
I have seen the CPU temperature spiking for a hole hour in netdata, the nice PVE graphs show me it's one of my LXC (Ubuntu) that is using the CPU, but looking at cron and other things I have running in it, I cannot find what is responsible. My jellyfin or *arr tasks are indeed scheduled to run during this time but their execution log says it completed in seconds, not a full hour...

As I'm not going to schedule my alarm to wake up at 4 in the morning just to run "ps aux", I was wondering if someone has any advice on how to find out, maybe schedule a simple ps aux, or some netdata settings to record the process name and command, ... How do you find out what has been running on your CPU ?

Thanks in advance for any help,
Edit: My clock was off, so I have now confirmed it is most probably my cron.daily that is causing this, I have enabled loglevel 2 for cron to see but I believe it will not help in seeing which script is taking 1 hour since they all seem to terminate in less than 1 minute...
Code:
ls -alh /etc/cron.daily/
total 40K
drwxr-xr-x  2 root root 4.0K May 14 10:50 .
drwxr-xr-x 84 root root 4.0K May 14 11:00 ..
-rw-r--r--  1 root root  102 Feb 13  2020 .placeholder
-rwxr-xr-x  1 root root 1.5K Apr  9  2020 apt-compat
-rwxr-xr-x  1 root root  355 Dec 29  2017 bsdmainutils
-rwxr-xr-x  1 root root 1.2K Sep  5  2019 dpkg
-rwxr-xr-x  1 root root  377 Jan 21  2019 logrotate
-rwxr-xr-x  1 root root 1.1K Feb 25  2020 man-db
-rwxr-xr-x  1 root root 4.5K Jul 18  2019 popularity-contest

Also, I do have a lot of processes running at any point in time on this LXC, so ps aux at the proper time would be nice, but a top command might be more useful.
I'm thinking to just add a cron.daily that waits for 10 minutes then does a top and logs output somewhere... Any better idea to find out what it is ? Or maybe already knowledge of the above scripts and which one can be so heavy...
Thanks in advance.
 
Last edited:
hi,

you could install atop and run it like so: atop -w process.log

this will create a file process.log which can be viewed again atop -r process.log

you could run it for a certain amount of time (can be scheduled in cron also) and then check the log