I want to do a shell who scan my server with uptime
and when uptime load average > 4, i want to write
the result of ps aux|head -5 in a file
for ex :
uptime
11:36 up 4 days, 12:26, 51 users, load average: 1.40, 1.03, 0.84
if uptime | awk -F" " '{print $10}' > 4 then
ps aux|head -5 > log
and when uptime load average > 4, i want to write
the result of ps aux|head -5 in a file
for ex :
uptime
11:36 up 4 days, 12:26, 51 users, load average: 1.40, 1.03, 0.84
if uptime | awk -F" " '{print $10}' > 4 then
ps aux|head -5 > log