source: n4d-proxy/trunk/fuentes/install.n4d-proxy/usr/bin/lliurex-proxy-cleaner @ 229

Last change on this file since 229 was 229, checked in by hectorgh, 4 years ago

adding project files

  • Property svn:executable set to *
File size: 520 bytes
Line 
1#!/bin/bash
2
3logger -t "lliurex-squid-cleaner" "Cleaning system"
4if [ -f /var/spool/squid3/swap.state ]; then
5        #:> /var/spool/squid3/swap.state
6        FILENAME=/var/spool/squid3/swap.state
7        SIZE=$(du -sb $FILENAME | awk '{ print $1 }')
8
9        if ((SIZE<4500000000)) ; then 
10            logger -t "lliurex-squid-cleaner" "Size seems normal: Nothing to do" 
11        else 
12            logger -t "lliurex-squid-cleaner" echo "Cleanup SQUID3"
13            sudo service squid3 stop
14            rm -f /var/spool/squid3/swap.*
15            sudo service squid3 start
16               
17        fi
18fi
19exit 0
Note: See TracBrowser for help on using the repository browser.