Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Cached 'favicons' in Safari can cause slowdowns' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Cached 'favicons' in Safari can cause slowdowns
Authored by: macfeller on Mar 29, '04 02:05:34PM

When I try the command nothing happens; the prompt merely returns. Not knowing anything really, I thought that I should substitute my actual home directory name for the word HOME. Nada. I get no such file or directory. Yes, there is the directory. Not sure if I even have a problem: I had not noticed a slowdown; the file is only 1.3 MB.



[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: FlashBIOS on Mar 29, '04 02:42:32PM
It should just return to the prompt with nothing "visibly" happening. Behinds the scenes the command finds all files (-type f) in your home's Safari icon folder ($HOME/Library/Safari/Icons) that were last accessed more than thirty days ago (-atime +30) whose name ends with .cache (-name "*.cache") and then deletes them (-delete). If you want to see something try changing the +30 to +2 and not including the -delete option. That would show all icons that haven't been accessed in the last two days. BTW, $HOME will work. It is a shell environmental variable -- think built into the command line. To try it out type echo $home and you should see the path to your home folder.

[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: macfeller on Mar 29, '04 06:40:50PM

Thanks for replying. Still no luck. When I do it and nothing happens but the prompt returning, the file is unchanged. When I changed the 30 to 2, the file is still the same. Finally, when I do echo $home, nothing again happens. TThe prompt merely returns. No file or pathway listing shows. I am logged in as an administrator user. It's not so much that I can't get it to work. It's that it doesn't and I don't know why. So it goes.



[ Reply to This | # ]
case matters
Authored by: hayne on Mar 30, '04 01:52:50AM

Make sure you use $HOME, not $home



[ Reply to This | # ]
case matters
Authored by: macfeller on Mar 30, '04 12:40:25PM

did that

nope



[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: ces3001 on Mar 29, '04 02:49:39PM
add the "-print" parameter before "-delete". (i.e. find $HOME/Library/Safari/Icons -type f -atime +30 -name "*.cache" -print -delete). This will tell you which files it's deleting. (If you put this in a cron job, though, you won't see the output.)

[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: sailorman on Mar 29, '04 07:18:05PM

I tried adding this routine to Macaroni as one of its jobs and Macaroni did not like it....When I ran it with the terminal I had the same result as macfeller, ie. Icon folder size stays the same. Surely I am overlooking something.



[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: macfeller on Mar 29, '04 09:08:32PM

Could this be a Jag vs. Panther thang? Different shells?



[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: Duaiwe on Mar 29, '04 09:08:39PM
the command works fine, and you don't need administrator access to use it. (It only access your own Library folder). The command Nugget listed does not generate any feedback if it works properly. It will just bring you right back to the prompt.

The command ces3001 listed will print out every file that it deletes. But, if it doesn't delete anything, it won't print anything out, and just drop you right back to the prompt.

The key here, is that the command only deletes icons that havn't been accessed in the last 30 days. So, if everything in that folder has been accessed in the last 30 days, the command won't delete anything, and the folder size will stay the same. If you just want it to delete everything, then drop the -atime +30 bit:

find $HOME/Library/Safari/Icons -type f -name "*.cache" -delete

---
To know recursion, you must first know recursion.

[ Reply to This | # ]

Cached 'favicons' in Safari can cause slowdowns
Authored by: bluehz on Mar 30, '04 08:02:41AM

Just doing a few tests - modified a cache file at $HOME/Library/Safari/Icons/15/15 to show a created/modified date of 12/25/2003. Then ran..

find $HOME/Library/Safari/Icons -type f -atime +30 -name "*.cache" -delete ... e.g.:

$HOME/Library/Safari/Icons/15/15/
-rw-r--r-- 1 XXXX XXXX 107 Dec 25 12:25 3107740148-3612648702.cache

It did not find or delete the file that was obviously over 30 days old. Apparently this find command will not recurse into dir, so the actual root "$HOME/Library/Safari/Icons/15" would have to show a modified/created date in the last 30 days.



[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: Duaiwe on Mar 30, '04 08:36:05AM

I believe that the "-atime" switch checks the <b>access</b> time of the file, and not the modification or creation times. (At least, it seems that way according to find's man pages).

So, since you accessed the file in order to change its created/modified dates, it was likely accessed in the last 30 days, and not deleted.

---
To know recursion, you must first know recursion.



[ Reply to This | # ]
Cached 'favicons' in Safari can cause slowdowns
Authored by: msk on Mar 30, '04 10:08:54AM

the "-delete" on find will not work if you access the GNU version of find, which happened to me because I have /sw/bin/find in my Unix path before /usr/bin/find, because I installed "findutils" from fink (and removed now). (-exec rm {} \; is a possible replacement)

Also, find always descends into directories. The problem is that a lot of these cache files are getting accessed more recently, at least on my machine I had only two icon cache files not accessed in the last day.

I put:

find /Users/*/Library/Safari/Icons -type f -name "*.cache" -delete

in /etc/daily.local, that way those pesty icons will get cleaned once a day--I'll move it to a different script (weekly or monthly) once I see that I got it right. You have to create that script, read the scripts in /etc/periodic to get more ideas.



[ Reply to This | # ]