Remove temp files at shutdown.
Here's how I remove temporary internet files at shutdown in 7.04.
First of all we need to make a backup of our sysklogd file, to do this type this in at the terminal:
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
Next we need to edit that same file:
gksudo gedit /etc/init.d/sysklogd
Once your editor opens the file scroll down to the stop) section and enter this at the bottom of that section:
rm -fr /tmp/* /tmp/.??* see below
log_begin_msg "Stopping system log daemon..."
start-stop-daemon --stop --quiet --pidfile $pidfile --name syslogd
rm -fr /tmp/* /tmp/.??*
Save the file and close, now when you reboot your temp files will be deleted.
The superior man is modest in his speech, but exceeds in his actions.
Confucius, The Confucian Analects
Chinese philosopher & reformer (551 BC - 479 BC)