oncode
10/25/2014 - 3:04 PM

Cleanup linux server.

Cleanup linux server.

#!/bin/sh
# Cleanup script

# clean /var/cache/apt/archives folder
apt-get -y clean

# remove unused libraries
apt-get -y remove $(deborphan)

# clean temp folders
rm -rf /tmp/*
rm -rf /var/tmp/*

# empty log files
for logs in `find /var/log -type f`; do > $logs; done