limpa_cache.1.1.sh
Publicado por matheus ferreira cardoso (última atualização em 26/02/2015)
[ Hits: 2.839 ]
Download 6163.limpa_cache_1.1.sh
Script simples para verificar quantidade total de memória e depois limpar o cache.
#!/bin/bash ################################################################# # sistema - limpeza de memoria cache # # Autor: Matheus Ferreira Cardoso # # Empresa : M-Unix # # Email: munix.root@gmail.com # ################################################################# echo "########################" echo "CALCULANDO MEMORIA TOTAL" echo "########################" sleep 5 dmidecode -t 19 | grep Range > teste.txt cat teste.txt rm -rf teste.txt echo "########################" sleep 5 echo "DESEJA LIMPAR A MEMORIA RAM? [sn] " read RESPOSTA test "$RESPOSTA" = "n" && exit #Limpar o cache da memoria RAM MEM1=`free|awk '/Mem:/ {print int(100*$3/$2)}'` free -m echo "##########################################################################" echo "Memória RAM Usada antes de fazer a limpeza:" $MEM1% echo "##########################################################################" echo " " echo "LIMPANDO MEMORIA --- RAM ---" sleep 3 sync echo 3 > /proc/sys/vm/drop_caches echo "LIMPANDO MEMORIA SWAP..." sleep 4 swapoff -a swapon /dev/sda5 echo "##########################################################################" MEM2=`free|awk '/Mem:/ {print int(100*$3/$2)}'` free -m echo "##########################################################################" echo "Uso de memória RAM após a limpeza:" $MEM2% "Economia de: " `expr $MEM1 - $MEM2`"%" echo "##########################################################################" exit
Protegendo arquivos contra acessos simultâneos
speedy.sh - Wget no popup do speedy home :-)
Restaurar backup de uma conta cpanel mesmo que ela já exista
Instala JRE no Firefox com Fedora
Enviar mensagem ao usuário trabalhando com as opções do php.ini
Meu Fork do Plugin de Integração do CVS para o KDevelop
Compartilhando a tela do Computador no Celular via Deskreen
Como Configurar um Túnel SSH Reverso para Acessar Sua Máquina Local a Partir de uma Máquina Remota
Configuração para desligamento automatizado de Computadores em um Ambiente Comercial
Compartilhamento de Rede com samba em modo Público/Anônimo de forma simples, rápido e fácil
Cups: Mapear/listar todas as impressoras de outro Servidor CUPS de forma rápida e fácil
Criando uma VPC na AWS via CLI
Problemas ao instalar o PHP (10)
Descompactar arquivos winrar no linux (9)
Tem como instalar o gerenciador AMD Adrenalin no Ubuntu 24.04? (12)