#!/bin/sh # /usr/local/sbin/cleanup source /etc/functions-colors Delete_From_TmpDir () { echo "Deleting from $TMPDIR" # delete files find $TMPDIR -type f -mtime +9 -exec rm -f {} \; # delete directories find $TMPDIR -type d -mtime +9 -exec rmdir {} \; } echo -e "${BOLDWHITE}Deleting junk.${COLOR_RESET}" echo "Deleting temporary files and directories older than 9 days." TMPDIR="/tmp" Delete_From_TmpDir TMPDIR="/var/tmp" Delete_From_TmpDir echo "Deleting miscellaneous temporary files." # delete known single files rm -f /tmp/.*-unix/* /tmp/.X*-lock # delete files recursively rm -rf /tmp/kde-*/* /tmp/.wine* echo "Deleting various log files." find /var/log/samba -size 0 -exec rm -f {} \; rm -f /var/log/Xorg.*.log.old # rm -f /var/log/kdm.log >/dev/null # rm -f /var/log/xdm.log >/dev/null # rm -f /var/log/gdm.log >/dev/null