{"id":33,"date":"1997-09-09T01:36:29","date_gmt":"1997-09-09T09:36:29","guid":{"rendered":"http:\/\/www.birdhouse.org\/betips\/?p=33"},"modified":"1997-09-09T01:36:29","modified_gmt":"1997-09-09T09:36:29","slug":"netpositive-clear-your-cache-automatically","status":"publish","type":"post","link":"https:\/\/www.betips.net\/?p=33","title":{"rendered":"NetPositive: Clear your cache automatically"},"content":{"rendered":"<p>[Editor&#8217;s note: NetPositive 2 has much better cache-handling features. Upgrade and you won&#8217;t need this tip!]<br \/>\nNetPositive&#8217;s cache will get large if you don&#8217;t trim it, but who wants to have to check repeatedly? It&#8217;s possible to have the cache files erased on startup, but that can be a pain if you reboot often or don&#8217;t use your computer for extended periods.<br \/>\nThe following chunk of code, when placed into your UserBootscript (\/boot\/home\/config\/boot\/UserBootscript) will clear NetPositive&#8217;s cache on startup, but only when it exceeds the size in K specified as &#8222;max&#8220; below, which is currently set to 4 megabytes in this example.<\/p>\n<pre>\nlet max=4096\nlet size=`du -s $HOME\/config\/settings\/NetPositive\/NetCache | cut -f1`\nif [ $size -gt $max ]; then\nrm -f $HOME\/config\/settings\/NetPositive\/NetCache\/*\nfi\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>[Editor&#8217;s note: NetPositive 2 has much better cache-handling features. Upgrade and you won&#8217;t need this tip!] NetPositive&#8217;s cache will get large if you don&#8217;t trim it, but who wants to have to check repeatedly? It&#8217;s possible to have the cache files erased on startup, but that can be a pain if you reboot often or [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[2],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","tag-applications"],"_links":{"self":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":0,"href":"https:\/\/www.betips.net\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.betips.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}