# cleanvar_enable purpose



## nabioullinr (Jun 19, 2010)

When cleanvar_enable is asserted (it appears to be, by default), what exactly is deleted in /var? Are only temporary files (e.g., not /var/log nor /var/www) deleted?


----------



## phoenix (Jun 19, 2010)

Reading through /etc/rc.d/cleanvar shows that /var/run, /var/spool/lock, and /var/spool/uucp/.Temp are cleaned (see bolded below):

```
cleanvar_start ()
{
        if [ -d /var/run -a ! -f /var/run/clean_var ]; then
                [b]purgedir /var/run[/b]
                # And an initial utmp file
                (cd /var/run && cp /dev/null utmp && chmod 644 utmp)
                >/var/run/clean_var
        fi
        if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
                [b]purgedir /var/spool/lock[/b]
                >/var/spool/lock/clean_var
        fi
        [b]rm -rf /var/spool/uucp/.Temp/*[/b]
}
```


----------

