how to cleanup old data and logs

167 views
Skip to first unread message

Gianluca Filippini

unread,
May 17, 2018, 5:35:44 PM5/17/18
to Grase Hotspot
hi,
I've searched in the forum but I did no find a clear answer... sorry if this has been asked already:

My grase box has been running for few years now and the hard disk is filling up with logs and huge databases.

is there a list of commands to delete everything (cleanup database, delete logs, backups etc) that is older than 1 month (or 1y) ?
I'm referring to anything that GRASE might keep for stats and internal logs.


thanks

Timothy White

unread,
May 20, 2018, 8:41:35 AM5/20/18
to Grase Hotspot
Hi Gianluca

Could you please run the support collection tool (https://grasehotspot.org/support/collecting-support-information/) to provide us with more information.

The reason I ask, is that there are automated scripts that clean up parts of the hotspot. In particular, the usage stats are in monthly totals, so take up very little space per user after 2-3 months. However, it may be possible you are running an older version where those scripts didn't work and so that database has kept growing.

Having said that, the first place to look to free up space is the backups directory. /var/backups/grase/database/
No current version cleans this up, and so you may have 5+ years of backups filling up that directory. Feel free to delete as much out of that as you want. I've created an issue (https://github.com/GraseHotspot/grase-www-portal/issues/174) to ensure that in the future we do cleanup that directory. Any suggestions on how much people want retained there by default would be appreciated.

Regards

Tim

--
This mailing list is for the Grase Hotspot Project http://grasehotspot.org
---
You received this message because you are subscribed to the Google Groups "Grase Hotspot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grase-hotspo...@grasehotspot.org.
To post to this group, send email to grase-...@grasehotspot.org.
Visit this group at https://groups.google.com/a/grasehotspot.org/group/grase-hotspot/.
To view this discussion on the web visit https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/72c142d4-1ab3-4729-be6b-53b60ff90354%40grasehotspot.org.

Gianluca Filippini

unread,
May 20, 2018, 2:30:44 PM5/20/18
to Grase Hotspot
Hi Tim,
thanks a lot for your reply.

indeed this is an extremely old machine (behind an IPfire fw .. which instead is always updated).
ok .. very old .. but still works just fine ..
:-D

turns out the database backup was 99% of the used space!
now my hdisk utilization went from 65% to 6% !! hurray.

btw: if there is some other table in mysql that I need to cleanup manually (or with a script) due to the old version of grase please let me know.

below are the info on the machine (minus local details)




Grase Support Information Script = 2016040401
== Grase Package versions ==
mysql-server:
  Installed: 5.1.69-0ubuntu0.11.10.1
  Candidate: 5.1.69-0ubuntu0.11.10.1
  Version table:
 *** 5.1.69-0ubuntu0.11.10.1 0
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric-updates/main amd64 Packages
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric-security/main amd64 Packages
        100 /var/lib/dpkg/status
     5.1.58-1ubuntu1 0
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
freeradius:
  Installed: 2.1.10+dfsg-3ubuntu0.11.10.1
  Candidate: 2.1.10+dfsg-3ubuntu0.11.10.1
  Version table:
 *** 2.1.10+dfsg-3ubuntu0.11.10.1 0
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric-updates/main amd64 Packages
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.1.10+dfsg-3 0
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
squid3:
  Installed: 3.1.14-1ubuntu0.3
  Candidate: 3.1.14-1ubuntu0.3
  Version table:
 *** 3.1.14-1ubuntu0.3 0
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric-updates/universe amd64 Packages
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     3.1.14-1 0
        500 http://old-releases.ubuntu.com/ubuntu/ oneiric/universe amd64 Packages
coova-chilli:
  Installed: 1.2.9-grase3
  Candidate: 1.3.0-22-g39df09b
  Version table:
     1.3.0-22-g39df09b 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
 *** 1.2.9-grase3 0
        100 /var/lib/dpkg/status
grase-conf-squid3-3.1:
  Installed: (none)
  Candidate: 1.6.13.gc9496e0
  Version table:
     1.6.13.gc9496e0 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
grase-conf-squid3-3.3:
  Installed: (none)
  Candidate: 1.6.13.gc9496e0
  Version table:
     1.6.13.gc9496e0 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
grase-conf-dnsmasq:
  Installed: 1.6
  Candidate: 1.6
  Version table:
 *** 1.6 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
        100 /var/lib/dpkg/status
grase-conf-apache2:
  Installed: 1.1
  Candidate: 1.1.12.gabb2ede
  Version table:
     1.1.12.gabb2ede 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
 *** 1.1 0
        100 /var/lib/dpkg/status
grase-www-portal:
  Installed: 3.7.7.6
  Candidate: 3.8.0
  Version table:
     3.8.0 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
 *** 3.7.7.6 0
        100 /var/lib/dpkg/status
grase-conf-freeradius:
  Installed: 1.9.4
  Candidate: 1.9.4.16.g0d854c6
  Version table:
     1.9.4.16.g0d854c6 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
 *** 1.9.4 0
        100 /var/lib/dpkg/status
grase-conf-nginx:
  Installed: (none)
  Candidate: 1.1
  Version table:
     1.1 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
grase-conf-openvpn:
  Installed: (none)
  Candidate: 1.7.1
  Version table:
     1.7.1 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
grase-conf-squid3:
  Installed: 1.5
  Candidate: 1.5
  Version table:
 *** 1.5 0
        100 /var/lib/dpkg/status
grase-remote-assist-user:
  Installed: (none)
  Candidate: 1.5
  Version table:
     1.5 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
grase-repo:
  Installed: 1.4
  Candidate: 1.7
  Version table:
     1.7 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
 *** 1.4 0
        100 /var/lib/dpkg/status
grase-www-portal-ext-libs:
  Installed: (none)
  Candidate: 3.8.0
  Version table:
     3.8.0 0
        500 http://packages.grasehotspot.org/ purewhite/main amd64 Packages
== Grase Repository Details ==
deb http://packages.grasehotspot.org/ purewhite main
== Grase DNS Details ==
#### This file is auto generated                              ####
#### Please do not edit it.                                   ####
#### Changes can be made in the Grase Hotspot Admin interface ####
#chilli_lanip 10.1.0.1
#chilli_wanif eth3
#chilli_lanif eth1
#chilli_network 10.1.0.0
#chilli_netmask 255.255.255.0

address=/grasehotspot.lan/10.1.0.1
address=/logout/1.0.0.0
address=/logoff/1.0.0.0

no-resolv
strict-order

expand-hosts
domain=hotspot.lan
server=192.168.40.1
server=8.8.4.4



cache deny all
== Linux Distro and version ==
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 11.10
Release:    11.10
Codename:    oneiric
== Network Information ==

= /etc/network/interfaces =
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth3
#iface eth3 inet dhcp

= Network Manager =
./collect-support-info.sh: 57: nmcli: not found
== Network Manager settings ==
cat: /etc/NetworkManager/NetworkManager.conf: No such file or directory
ls: cannot access /etc/dnsmasq.d/network-manager: No such file or directory
cat: /etc/dnsmasq.d/network-manager: No such file or directory
= Hard disk information =
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             184G  104G   71G  60% /
udev                  7.9G  4.0K  7.9G   1% /dev
tmpfs                 3.2G  2.1M  3.2G   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  7.9G     0  7.9G   0% /run/shm
/dev/sda2              92M   50M   38M  57% /boot
= Status of services =
== CoovaChilli ==
./collect-support-info.sh: 57: systemctl: not found
status: Unknown job: chilli
./collect-support-info.sh: 57: systemctl: not found
Usage: /etc/init.d/freeradius start|stop|restart|force-reload|reload
./collect-support-info.sh: 57: systemctl: not found
Apache2 is running (pid 1710).
./collect-support-info.sh: 57: systemctl: not found
ulimit: 33: error setting limit (Operation not permitted)
Usage: /etc/init.d/squid3 {start|stop|reload|force-reload|restart}
./collect-support-info.sh: 57: systemctl: not found
mysql start/running, process 1034
./collect-support-info.sh: 57: systemctl: not found
network-manager: unrecognized service


===============================================================================

Timothy White

unread,
May 20, 2018, 3:40:08 PM5/20/18
to Grase Hotspot
The radpostauth table is the one that grows large. It was fixed in 3.7.7.8. Is there any reason you haven't upgraded to a newer version?
You can see the difference between your current version and 3.7.7.8 at https://github.com/GraseHotspot/grase-www-portal/compare/3.7.7.6...3.7.7.8

Ideally, if you can upgrade, that would help. Otherwise you'll need to manually keep the radpostauth table under control. (Also, because it's grown, truncating it won't free up disk space, but will improve performance. The MySQL DB can't ever shrink, but it will stop growing).

Regards

Tim

Reply all
Reply to author
Forward
0 new messages