![]() If you would like to run this job through root, you can add an entry like this: ![]() Change the permissions for the script files.$WORKING_DIR/cpu_usage.sh > $WORKING_DIR/cpu_usage_`date +%Y%m%d`.log Compose a script for easily logging and can be added to the crontab.Ps -eo pid,user,pcpu,pmem,stime,args | sort -k3rn | headĮcho "=" It sorts CPU utilization percentage by defaults, but the column COMMAND is too simple to judge which processes are taking most of CPU resource, you have to see the details by "ps" command such as the following to find the correct process name with a known ~]$ ps -ef | awk ''`"%"Įcho " PID USER CPU MEM START PROCESS_NAME"Įcho "-" OP usually have been told and trained to use "top" command to monitor the overall status of a server, the "top" command can show many useful information like PID, USERNAME, CPU, RES, COMMAND, etc.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |