bdquick Admin
Posts : 583 Join date : 2010-02-22 Age : 45 Location : Central Iowa
| Subject: Keep your /tmp folder clean automatically Fri Sep 14, 2012 8:16 pm | |
| I like to keep my temp folders cleaned out. Generally nothing in there that I need to keep and it just wastes hard drive space. If you'd like your computer to do some house keeping for you:
- Go To YAST -> System -> /etc/sysconfig Editor
- Expand "System"
- Expand "Cron"
- Now you will see several entries you can change. Set them to values you feel are reasonable for you.
- "MAX_DAYS_IN_TMP" - This is the number of days a file can go unused in /tmp before deletion. I have mine set to 14 days.
- "TMP_DIRS_TO_CLEAR" - This is probably blank so it defaults to /tmp. If you would like to clear other folders, they could be added here.
- "OWNER_TO_KEEP_IN_TMP" - Files created by the specified user will not be deleted. Defaults to "root".
- "CLEAR_TMP_DIRS_AT_BOOTUP" - Like it says will clean them out while booting up. This ignores the owners to keep option, and deletes all files no matter owner or number of days. This is probably defaulted to "no". I have mine set to "yes".
- "DAILY_TIME" - This is to set the time you want the /tmp folders cleared. If you have a server that is on all the time you could have them cleared out at 3 A.M. to avoid slowing down daily traffic. The time should be entered in 24 hour time, not 12 hour.
There is also an option to set up a "long tmp" folder(s). Perhaps useful if you a folder where you create backups, but don't need them after a certain period. | |
|
bozo Admin
Posts : 402 Join date : 2010-02-23 Location : Way out in the sticks in the Gold Country of California
| Subject: Re: Keep your /tmp folder clean automatically Fri Sep 14, 2012 11:41 pm | |
| this sounds like a good idea. Every so often I think about cleaning out the /tmp folder, but I'm always to chicken to delete stuff that I don't know what it is. If I'd set it up to do it automatically, I just woldn't know about it. What I don't know wan't hurt me, right? | |
|
Laz Gecko
Posts : 201 Join date : 2012-06-13 Location : Delta BC
| Subject: Re: Keep your /tmp folder clean automatically Sat Sep 15, 2012 11:46 am | |
| Is there a valid reason for keeping TMP files? Seems to me anything one wants to keep will be saved anyway. I always looked on TMP files as a "scratchpad" or work in progress. Am I wrong in this? | |
|
bdquick Admin
Posts : 583 Join date : 2010-02-22 Age : 45 Location : Central Iowa
| Subject: Re: Keep your /tmp folder clean automatically Sat Sep 15, 2012 1:51 pm | |
| I don't know of any reason to keep them. I've never understood why the default isn't to remove them, but I don't know of any distro that defaults to removing them either. Its something I always try and remember to set, but often forget. | |
|
Laz Gecko
Posts : 201 Join date : 2012-06-13 Location : Delta BC
| Subject: Re: Keep your /tmp folder clean automatically Sat Sep 15, 2012 7:13 pm | |
| Never thought to look at Cron to do this. Great tip! | |
|
coldkeys Newt
Posts : 1 Join date : 2014-09-16
| Subject: Re: Keep your /tmp folder clean automatically Tue Sep 16, 2014 4:47 am | |
| Thank you, this a great time saver - and a way of using cron I was not aware of. | |
|
Sponsored content
| Subject: Re: Keep your /tmp folder clean automatically | |
| |
|