Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ddublu

macrumors 65816
Original poster
Jun 26, 2011
1,368
73
I found a couple of scripts online that I should run but nothing works....There are 8 timemachine backup folders that I am trying to delete....runs through and eventually gives and error code -22. What else should I try?
 
Last edited:

ddublu

macrumors 65816
Original poster
Jun 26, 2011
1,368
73
You probably need to provide a bit more details of what it is you are trying to do, what doesn't work and link to the scripts you have been using.

I am trying to empty my trash. Within my trash are 8 folders of different TM backups. Not sure why I can't just delete them like any other file. I can't find the script I was using before (whatever it was it didnt change anything). The scripts have nothing to do with the errors....they show up toward the end of the trash being emptied (but then nothing is actually done).
 

Taz Mangus

macrumors 604
Mar 10, 2011
7,815
3,504
I am trying to empty my trash. Within my trash are 8 folders of different TM backups. Not sure why I can't just delete them like any other file. I can't find the script I was using before (whatever it was it didnt change anything). The scripts have nothing to do with the errors....they show up toward the end of the trash being emptied (but then nothing is actually done).

Did you drag the time machine backups to your trash from your time machine drive? And when you say time machine backups are you indicating the folder that was at the root of the time machine drive? Need to give more information about the backups that are sitting in your trash. There are ways to flush the trash but it requires more information otherwise you could cause an issue with your time machine drive and OS X.
 

ddublu

macrumors 65816
Original poster
Jun 26, 2011
1,368
73
Did you drag the time machine backups to your trash from your time machine drive? And when you say time machine backups are you indicating the folder that was at the root of the time machine drive? Need to give more information about the backups that are sitting in your trash. There are ways to flush the trash but it requires more information otherwise you could cause an issue with your time machine drive and OS X.

I went to my Backups.backupdb folder, then to my MBP named folder (Aug2014rMBP) and then right clicked on a few folders below it to free up some space on my external drive. It shows them in my MBP trash but when I click on the actual folder in my trash can and select get info it shows the path as still on my external drive (that very well may be normal). Does that help? It lets me delete all trash in there except for these folders...I even tried to just put them back in an effort to move on from this and that option isn't available.
 

Taz Mangus

macrumors 604
Mar 10, 2011
7,815
3,504
I went to my Backups.backupdb folder, then to my MBP named folder (Aug2014rMBP) and then right clicked on a few folders below it to free up some space on my external drive. It shows them in my MBP trash but when I click on the actual folder in my trash can and select get info it shows the path as still on my external drive (that very well may be normal). Does that help? It lets me delete all trash in there except for these folders...I even tried to just put them back in an effort to move on from this and that option isn't available.

It is not a good idea to manually delete backups from the time machine hard drive. I would suggest opening the trash select each backup and then click on "Put Back". Then enter time machine, select a date and then do a delete the backup. Let time machine delete the backups.
 
Last edited:

GatorGhost

macrumors regular
Jun 30, 2014
113
19
I found a couple of scripts online that I should run but nothing works....There are 8 timemachine backup folders that I am trying to delete....runs through and eventually gives and error code -22. What else should I try?

Not sure if this will help, but I assume you moved Time Machine files from an external drive to your desktop trash bin? I did this and encountered the same problem. I unmounted the usb drive and was able to remove all trash files for Time Machine. Just guessing, but it appears the trash files were addressing the external drive for some reason and hanging up the deletion.
 

ddublu

macrumors 65816
Original poster
Jun 26, 2011
1,368
73
It is not a good idea to manually delete backups from the time machine hard drive. I would suggest opening the trash select each backup and then click on "Put Back". Then enter time machine, select a date and then do a delete the backup. Let time machine delete the backups.

Like I mentioned above, I tried that already.
 

ddublu

macrumors 65816
Original poster
Jun 26, 2011
1,368
73
Not sure if this will help, but I assume you moved Time Machine files from an external drive to your desktop trash bin? I did this and encountered the same problem. I unmounted the usb drive and was able to remove all trash files for Time Machine. Just guessing, but it appears the trash files were addressing the external drive for some reason and hanging up the deletion.

I believe I right clicked on them in my external drive and moved to trash....now trying to get them out of trash isnt working.
 

Taz Mangus

macrumors 604
Mar 10, 2011
7,815
3,504
Like I mentioned above, I tried that already.

I guess I missed that part. Anyway, a couple of things to try.

First, select Finder->"Secure Empty Trash..." from the menubar. See that works. If it does not work then try the following:
  • Open the terminal application.
  • Enter: cd .Trash
  • Enter: ls -a

If you see the backups that you deleted in .Trash then from the terminal app:
  • Enter: sudo rm -rf <The name of the backup as shown in "ls -a" command>

If you don't see your backups in .Trash then from the terminal app:
  • Enter: cd /.Trashes
  • Enter: sudo ls -a

In /.Trashes you will see numbers, these are the user account IDs. Each user has its own account user ID. From the terminal app:
  • Enter: id -u

That command will display your user account ID. In the terminal app:
  • Enter: cd <your user account id shown in "id -u" command>
  • Enter: sudo ls -a

You should see a list of the time machine backups. In the terminal app:
  • Enter: sudo rm -rf <The name of the backup as shown in the "sudo ls -a" command>

This should get rid of the time machine backups in the trash.

EDIT: I have thought about this more and I believe the reason you can't empty the trash is because the permissions of the files in the trash need to be changed. So where I state do "rm -rf <filename>" or "sudo rm -rf <filename>" just do a "chmod -R 777 *" or "sudo chmod -R 777 *". You should then be able to empty trash through finder like you normally do.
 
Last edited:

GatorGhost

macrumors regular
Jun 30, 2014
113
19
I believe I right clicked on them in my external drive and moved to trash....now trying to get them out of trash isnt working.

When I was able to remove the external trash. I completely disconnected the external drive and restarted... and then deleted the trash...maybe I was lucky.
 

ddublu

macrumors 65816
Original poster
Jun 26, 2011
1,368
73
When I was able to remove the external trash. I completely disconnected the external drive and restarted... and then deleted the trash...maybe I was lucky.

When I unplug the drive there is nothing shown in my trash.
 

GatorGhost

macrumors regular
Jun 30, 2014
113
19
When I unplug the drive there is nothing shown in my trash.

Maybe partition the external drive and put all you want to save in the new partition and erase and format the old partition. Then try to delete.
A wild guess for the brave...huh?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.