Remove temp files at shutdown.

Discussion in 'Installation/Configuration' started by mrwasabi, Jun 28, 2007.

  1. mrwasabi

    mrwasabi New Member

    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
    ===============================================
    stop)
    log_begin_msg "Stopping system log daemon..."
    start-stop-daemon --stop --quiet --pidfile $pidfile --name syslogd
    log_end_msg $?
    rm -fr /tmp/* /tmp/.??*

    Save the file and close, now when you reboot your temp files will be deleted.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Isn't the /tmp folder cleaned up automatically when you reboot? At least it's like that on Debian.
     

Share This Page