-
Posts
11 -
Joined
-
Last visited
Posts posted by bpmircea
-
-
-
Gasire proces ce papa mult RAM dupa nume, terminare + log:
Se inlocuie !!NAME!! cu ce aveti nevoie.
Este folositor cand stiti ca un anumit proces mananca mult, si vreti sa il inchideti automat.
Se face CRON pe fisier si se rezolva.
Sper ca ajuta pe cineva, mie mi-a fost de folos.
#! /bin/bash
# Author : zekStein++ ( Adrian Constantin # b3kwz@yahoo.com )
iMaxUsage=512000 #This is the maximum memory usage permited !
#Here we took all the pids of the running processes
iPids=$( ps -U root -u root -N | grep !!NAME!! | grep -o -P "(.*)(?=pts)");
#Here we parse the PIDS and search for HIGH MEMORY USAGE !
for i in $iPids
do
#Here we check all the usages for that PIDS !
iMemoryUsage=$( pmap $i | awk -F"total" '{print $2}' | grep K | tr -d " " | tr -d "K" );
#Here we will compare with the maximum MEMORY USAGE PERMITED!
#Also, we kill the process and log it to know at any time who was the joker .
if [ $iMemoryUsage -gt $iMaxUsage ]
then
sPidOwner=$(ps -ef | grep $i | grep -o -P '(.*)(?=$i)' | cut -d"r" -f1 | grep " "); # Unstable.
sDateAndTime=$(date)
kill $i
echo "Data si ora : $sDateAndTime , utilizator : $sPidOwner ;" >> /home/InformatiiConsumRam.log
fi
done
#Script job done !eu il caut cu top si dupa aia omor procesul cu kill, ceva in genul asta:
top | grep nume_program
kill PID_de_program -
am stat si eu in germania, eu le descarcam pe RDP (rdp cu 16GB ram ; proc am uitat dar era destul de puternic) le schimbam denumirea arhivam si descarcam de pe rdp .. fara vpn si alte prostii, recomand metoda..
explica un pic procesul, nu inteleg nimic
multumesc
-
Recomandati-mi un VPN premium ce merita bani din plin Vreau sa suporte si trafic p2p. Multumesc!
am aceeasi intrebare
Top 10 seriale la ora actuala
in Discutii non-IT
Posted
twd
got
The Sopranos
bb
bbt
soa
carnivale
Orange is the new black
astea sun favoritele mele