Clean up / filesystem

Mike Clarke jmc-freebsd2 at milibyte.co.uk
Sun Oct 10 08:40:33 UTC 2010


On Saturday 09 October 2010, Arthur Chance wrote:

> Not if running an X desktop, as all sorts of things get stuck in /tmp
> that are needed. In single user mode it should be safe, and it
> probably is when simply running on the console.
>
> As a long term solution, if you wish to clear /tmp every reboot add
> clear_tmp_enable="YES"  # Clear /tmp at startup.
> to your /etc/rc.conf

Also consider using periodic(8) to do a safe daily cleanup deleting 
files in /tmp not accessed in the last 3 days. You need to add 
daily_clean_tmps_enable="YES" to /etc/periodic.conf. If you prefer a 
different retention period you can set it by adding a line setting 
daily_clean_tmps_days to the desired value. You can also modify the 
default list of files to ignore with the variable 
daily_clean_tmps_ignore

-- 
Mike Clarke


More information about the freebsd-questions mailing list