3

I am trying to delete a directory stored on a Windows 2008 R2 server, mounted on a Mac as network home (10.8.5). The directory was created by Safari and stores temporary internet files. I need to be able to delete this folder on logout to support cache redirection.

The Terminal on Mac shows the directory as empty:

36W-FacRm-02:History lwickham$ cd /home/lwickham/Library/Caches/Metadata/Safari/History
36W-FacRm-02:History lwickham$ ls -al
total 0
drwx------ 1 lwickham CGPS\Domain Users 264 Nov 8 09:24 .
drwx------ 1 lwickham CGPS\Domain Users 264 Nov 8 09:28 ..

However, on the Windows server it has a single 0kb file that doesn't start with a "." but yet is invisible to the Mac.

E:\FacultyHome2\lwickham\Library\Caches\Metadata\Safari\History>dir
 Volume in drive E is FacultyUsers2
 Volume Serial Number is 8C17-4EF3

 Directory of E:\FacultyHome2\lwickham\Library\Caches\Metadata\Safari\History

11/08/2013  09:24 AM    <DIR>          .
11/08/2013  09:24 AM    <DIR>          ..
11/07/2013  04:28 PM                 0 http?%2F%2Fwww.google.com%2Furl?sa=t&rct=
j&q=&esrc=s&source=web&cd=6&ved=0CFsQFjAF&url=http%253A%252F%252Fwww.usbanklocat
ions.com%252Fhsbc-bank-usa-96th-street-branch.html&ei=5vR7UtmXEPjfsATe0YCIBA&usg
=AFQjCNF9ypKbpYbXRng00FY3W8Y6cF1Tiw&bvm=bv.56146854,d.
               1 File(s)              0 bytes
               2 Dir(s)  514,231,967,744 bytes free

All my attempts to delete the dir from the Mac have failed:

36W-FacRm-02:History lwickham$ rm -fr /home/lwickham/Library/Caches/Metadata/Safari/History/*
36W-FacRm-02:History lwickham$ rm -frd /home/lwickham/Library/Caches/
rm: /home/lwickham/Library/Caches//Metadata/Safari/History: Directory not empty
rm: /home/lwickham/Library/Caches//Metadata/Safari: Directory not empty
rm: /home/lwickham/Library/Caches//Metadata: Directory not empty
rm: /home/lwickham/Library/Caches/: Directory not empty

Some new files have been created since I last looked. They appear to start with "http/" and show up in both the Mac and Windows side. However, the file that starts with "http?" continues to only be visible on Windows. Notice the total of 6 files on mac and 7 on Windows

Directory of E:\FacultyHome2\lwickham\Library\Caches\Metadata\Safari\History

11/11/2013  10:47 AM    <DIR>          .
11/11/2013  10:47 AM    <DIR>          ..
11/11/2013  10:47 AM               202 https?%2F%2Fwww.google.com%2Fsearch?clien
t=safari&rls=en&q=disable+spotlight+launchd&ie=UTF-8&oe=UTF-8.webhistory
11/11/2013  10:46 AM               244 https?%2F%2Fwww.google.com%2Fsearch?clien
t=safari&rls=en&q=how+do+I+do+a+quit+claim+deed+in+new+york+city&ie=UTF-8&oe=UTF
-8.webhistory
11/11/2013  10:47 AM             2,004 http?%2F%2Fwww.cgps.org%2F.webhistory
11/11/2013  10:47 AM               324 http?%2F%2Fwww.google.com%2Furl?sa=t&rct=
j&q=&esrc=s&source=web&cd=1&ved=0CCsQFjAA&url=http%253A%252F%252Fosxdaily.com%25
2F2011%252F12%252F10%252Fdisable-or-enable-spotlight-in-mac-os-x-lion%252F&ei=H_
yAUpqqM6SxsAT9w4BY&usg=AFQjCNEUPAuccRHkNM7yl0alnETvA2-
11/08/2013  10:48 AM                 0 http?%2F%2Fwww.google.com%2Furl?sa=t&rct=
j&q=&esrc=s&source=web&cd=19&ved=0CJIBEBYwCDgK&url=http%253A%252F%252Fforums.mac
rumors.com%252Fshowthread.php%253Ft%253D664445&ei=mwd9UqTDIsagsQTG-oCoBQ&usg=AFQ
jCNHW7DdAq8pwA9JNvBcruMj-IbV2rA&bvm=bv.56146854,d.cWc.
11/11/2013  10:46 AM               339 http?%2F%2Fwww.google.com%2Furl?sa=t&rct=
j&q=&esrc=s&source=web&cd=2&ved=0CFYQFjAB&url=http%253A%252F%252Fwww.nytimes.com
%252F2003%252F06%252F01%252Frealestate%252Fq-a-quit-claim-deed-and-title-insuran
ce.html&ei=zvuAUvOlG8n_4APR6IC4Cg&usg=AFQjCNGLiAdM7qgs
11/07/2013  04:28 PM                 0 http?%2F%2Fwww.google.com%2Furl?sa=t&rct=
j&q=&esrc=s&source=web&cd=6&ved=0CFsQFjAF&url=http%253A%252F%252Fwww.usbanklocat
ions.com%252Fhsbc-bank-usa-96th-street-branch.html&ei=5vR7UtmXEPjfsATe0YCIBA&usg
=AFQjCNF9ypKbpYbXRng00FY3W8Y6cF1Tiw&bvm=bv.56146854,d.
               7 File(s)          3,113 bytes
               2 Dir(s)  516,569,677,824 bytes free



4WN-408-Teacher:~ lwickham$ ls -labi /home/lwickham/Library/Caches/Metadata/Safari/History
total 48
100050239 drwx------  1 lwickham  CGPS\Domain Users   264 Nov 11 10:47 .
100049965 drwx------  1 lwickham  CGPS\Domain Users   264 Nov 11 10:49 ..
100391816 -rwx------  1 lwickham  CGPS\Domain Users  2004 Nov 11 10:47 http:%2F%2Fwww.cgps.org%2F.webhistory
100392984 -rwx------  1 lwickham  CGPS\Domain Users   324 Nov 11 10:47 http:%2F%2Fwww.google.com%2Furl?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCsQFjAA&url=http%253A%252F%252Fosxdaily.com%252F2011%252F12%252F10%252Fdisable-or-enable-spotlight-in-mac-os-x-lion%252F&ei=H_yAUpqqM6SxsAT9w4BY&usg=AFQjCNEUPAuccRHkNM7yl0alnETvA2-
100392041 -rwx------  1 lwickham  CGPS\Domain Users   339 Nov 11 10:46 http:%2F%2Fwww.google.com%2Furl?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CFYQFjAB&url=http%253A%252F%252Fwww.nytimes.com%252F2003%252F06%252F01%252Frealestate%252Fq-a-quit-claim-deed-and-title-insurance.html&ei=zvuAUvOlG8n_4APR6IC4Cg&usg=AFQjCNGLiAdM7qgs
100392041 -rwx------  1 lwickham  CGPS\Domain Users   339 Nov 11 10:46 http:%2F%2Fwww.google.com%2Furl?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CFYQFjAB&url=http%253A%252F%252Fwww.nytimes.com%252F2003%252F06%252F01%252Frealestate%252Fq-a-quit-claim-deed-and-title-insurance.html&ei=zvuAUvOlG8n_4APR6IC4Cg&usg=AFQjCNGLiAdM7qgs
100392982 -rwx------  1 lwickham  CGPS\Domain Users   202 Nov 11 10:47 https:%2F%2Fwww.google.com%2Fsearch?client=safari&rls=en&q=disable+spotlight+launchd&ie=UTF-8&oe=UTF-8.webhistory
100391867 -rwx------  1 lwickham  CGPS\Domain Users   244 Nov 11 10:46 https:%2F%2Fwww.google.com%2Fsearch?client=safari&rls=en&q=how+do+I+do+a+quit+claim+deed+in+new+york+city&ie=UTF-8&oe=UTF-8.webhistory
5
  • 1
    Why can't you perform a recursive file delete command on the contents of the folder then delete the folder? Otherwise you might have to determine what the file is and/or delete it on the server itself and prevent the file from being recreated.
    – Ramhound
    Nov 8, 2013 at 15:51
  • Thats exactly what I did. You can see my results above. I get "Directory not empty". I can delete it from the server, but the Mac OS / Safari recreate similar files on every use. I can run a script on the server every night to delete these files, but for optimum use in our environment it should happen on the client at logout.
    – AdamG
    Nov 8, 2013 at 19:45
  • I glazzed over the -r... I assume drive E is using the NTFS filesystem?
    – Ramhound
    Nov 8, 2013 at 19:50
  • What does a ls -labi /home/lwickham/Library/Caches/Metadata/Safari/History give you? You have "bad characters" in the name (the ?). The -b should show you that. If the file is listed we can give you a solution to delete it.
    – Rik
    Nov 9, 2013 at 13:12
  • Did not work, but is now even stranger. See added details above.
    – AdamG
    Nov 11, 2013 at 15:58

2 Answers 2

0

I'll make an answer of this. It's easier:


Actually it gets even stranger: You are missing 2 files and 1 file is duplicated on the Mac side.

Look at the 3 from Mac with www.google.com%2Furl. You got 1x cd=1 and 2x cd=2. In Windows you got cd=1, cd=19, cd=2 and cd=6. Or am i missing something?

You can also look at the inode-numbers (that's why i suggested the -labi).
You got two 100392041s. (or is this a copy/paste mistake?)

Further, if we look at the 2 which are missing... they both have ,d near the end of the filename. (don't know yet why they are missing but it's a start)

Also both those files are 0 bytes in size. Can these be deleted on the Windows side?

If Safari has trouble saving cache files with a comma (like Adobe did here) maybe the directory entry is made but a file is never created. Then you would have a "ghost-entry" in the directory on NTFS.

Did you run a chkdsk on the Windows-side to see if the directory entries are ok?

If this is the case and you have directory corruption because of this, it's Safaris fault and these entries can't be just deleted without a repair of the NTFS-structure.

BTW. It seems that your problem is only with the "redirect"-link caches from Google (Google extends all its searchlinks to track your clicks). You can disable this behavior by installing an extension for Safari. See here for gDirectLinks. After installing, when clicking a link, you'll get straight to that site, without Google redirecting it via its tracking sites. It's a rough patch for your situation, but perhaps it's enough.

0

I had this issue on an USB stick with some git repositories.

sudo rm -rf /path/to/folder/

Removing the directory with sudo worked for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .