January 14, 2007
Remove temp folder contents on shutdown
A few days ago Codejacked wrote an article talking about Delete your TEMP files on shutdown for Windows. As much as I loved the article, I have recently switched over to Ubuntu. Like all operating systems, GNU Linux has temporary files also. Here’s how to delete them on shutdown.
- Back up what you’re going to working on.
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup- Open the file in
gedit
gksudo gedit /etc/init.d/sysklogd- Find the following section
... stop) log_begin_msg "Stopping system log daemon..." start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile log_end_msg $?... stop<span class="o">)</span> log_begin_msg <span class="s2">"Stopping system log daemon..."</span> start-stop-daemon --stop --quiet --oknodo --exec <span class="nv">$binpath</span> --pidfile <span class="nv">$pidfile</span> log_end_msg <span class="nv">$?</span> ...- Add the following line after
log_end_msg $?or before;;.
rm -fr /tmp/* /tmp/.??*- Save the file and you’re set!
Related Posts
- Dec 18, '09 Object Type in Javascript
- Dec 17, '09 Pure JavaScript Flatten Array
- Dec 12, '09 lala extremely flawed
- Dec 08, '09 Web Apps Feeding Web Apps
- Oct 14, '09 Tip: Recursively Open TextMate Project Folders
- Add the following line after
- Find the following section
- Open the file in