Issue deleteing on mounted trash

If I try to remove an empty folder from a mounted trash drive on google I get this error:

Dir.Remove failed to remove directory: directory not empty

I did ls -al on the directory, and it returned 0 items.

This is because on a Gdrive, deleted files are still located in the same folder as they were when you deleted them to trash. They don't actually go anywhere - they are just marked as trash and normally ignored as a result. when you use the --drive-trashed-only this behaviour is just reversed. It shows on ly trashed files and hides the non-trash.

So in short - this almost certainly means you have other (non-deleted) files in that folder - so it can't allow you to remove it.

Perhaps the rclone cleanup MyGdriveRemote: command would be useful for you. That just sends a signal to Gdrive to hurry up and empty all trashed files now rather than wait the usual 30 days. This usually happens fast, but be aware that it may take a few minutes to get done - or even a few hours if the server are under heavy load. It's a "low priority" task for the server that it does when it has free resources.

I am trying to delete all folder level objects in my trash. While leaving objects

Ok, well in that case I guess you have to do it manually (or at least programmatically in a script at best). The cleanup just nukes all trash indiscriminately.
In this case you won't have much choice but to make sure that any folder you want to delete is free of non-trash files.

Making a second remote specifically for trash, mounting them both and them having them side-by-side will let you get a very clear view of what is happening here - and then you can easily re-locate files you want to keep for instance - if you want to get rid of these folders.

Is this suitable for your need? Give it a shot, and if you still have questions then let me know and I will try to help further.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.