-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLimpiezaServer.sh
46 lines (38 loc) · 1.55 KB
/
LimpiezaServer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
echo "<---------------------------------------------------------->"
echo "<---------------------------------------------------------->"
echo "Comprobando estado de memoria"
free
echo "OK - Comprobacion completada"
echo "<---------------------------------------------------------->"
sleep 2s; echo “Limpieza de memoria cache y swap“;
echo "<---------------------------------------------------------->"
sleep 2s; echo "Deshabilitando HTTP"
killall -KILL httpd
echo "OK - Http deshabilitado"
echo "<---------------------------------------------------------->"
sleep 5s; echo "Deshabilitando Swap"
swapoff -a
echo "OK - Swap deshabilitado"
echo "<---------------------------------------------------------->"
sleep 5s; echo "Liberando page-caches, dentries e inodes"
sync;sysctl -w vm.drop_caches=3;sync
echo "OK - Server liberado"
echo "<---------------------------------------------------------->"
sleep 2s; echo "Habilitando la Swap"
swapon -a
echo "OK - Swap habilitado"
echo "<---------------------------------------------------------->"
sleep 2s; echo "Habilitando HTTP"
service httpd start
echo "OK - Http habilitado"
echo "<---------------------------------------------------------->"
sleep 3s; echo "Mantenimiento rutinario"
echo "Script liberador sh"
echo "Created by Sergio G.B."
echo "http://www.sololinux.es"
echo "<---------------------------------------------------------->"
sleep 2s; free
echo ".....TODO CORRECTO....."
echo "<---------------------------------------------------------->"
echo "<---------------------------------------------------------->"