# \--drive-trashed-only weird occurrence

**URL:** <https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066>\
**Category:** Help and Support\
**Created:** [July 30, 2019, 11:11pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066 "2019-07-30T23:11:15Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![bulls23ant](https://forum.rclone.org/user_avatar/forum.rclone.org/bulls23ant/32/2416_2.png) [@bulls23ant](https://forum.rclone.org/u/bulls23ant)\
**Post date:** [July 30, 2019, 11:11pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/1 "2019-07-30T23:11:15Z")

</div>

So I was running the following command rclone delete “asusbkp:C Drive” --drive-trashed-only. Now, what I would’ve expected to happen was it would delete files that are in the trash only but it actually deleted files in the “C Drive” folder (sent them to trash). I remember having used this command to empty the trash on a team drive before. Is this supposed to work as I thought it would?

---

<div class="post-metadata">

**Author:** ![bulls23ant](https://forum.rclone.org/user_avatar/forum.rclone.org/bulls23ant/32/2416_2.png) [@bulls23ant](https://forum.rclone.org/u/bulls23ant)\
**Post date:** [July 30, 2019, 11:11pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/2 "2019-07-30T23:11:58Z")

</div>

I forgot to add I’m using rclone 1.48 on windows 10. The remote is a google team drive.

---

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [July 30, 2019, 11:18pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/3 "2019-07-30T23:18:19Z")

</div>

rclone cleanup empties the trash.

So:

rclone cleanup remotename:

---

<div class="post-metadata">

**Author:** ![bulls23ant](https://forum.rclone.org/user_avatar/forum.rclone.org/bulls23ant/32/2416_2.png) [@bulls23ant](https://forum.rclone.org/u/bulls23ant)\
**Post date:** [July 30, 2019, 11:23pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/4 "2019-07-30T23:23:07Z")

</div>

I remember reading somewhere that the cleanup command doesn’t work on Team Drives, something to do with the API. So that’s why I was trying that other command.

---

<div class="post-metadata">

**Author:** ![thestigma](https://forum.rclone.org/user_avatar/forum.rclone.org/thestigma/32/3414_2.png) [@thestigma](https://forum.rclone.org/u/thestigma)\
**Post date:** [July 31, 2019, 12:01am UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/5 "2019-07-31T00:01:17Z")

</div>

I use teamdrives, and I'm pretty sure I have used it sucessfully several times.

However, you need to be aware that this only send a signal to Gdrive to "do it eventually". Just because cleanup finishes really quickly doesn't mean the files are gone yet. Only that they will be removed with time. I believe Gdrive still basically has to go through and delete them one by one, which not only can take a long time but also is probably something they only prioritize doing when server-load is low.

It usually works pretty fast for me - seconds or minutes at worst. The documentation states something like "minutes or days" so it can probably vary wildly.

---

<div class="post-metadata">

**Author:** ![bulls23ant](https://forum.rclone.org/user_avatar/forum.rclone.org/bulls23ant/32/2416_2.png) [@bulls23ant](https://forum.rclone.org/u/bulls23ant)\
**Post date:** [July 31, 2019, 9:47am UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/6 "2019-07-31T09:47:46Z")

</div>

I tried the cleanup command last night and nothing has been deleted from the trash so I don't think that is working for team drives. But what is really worrying is that it seems that the --drive-trashed-only flag is not working properly. I ran the following test:

rclone version  
rclone v1.48.0

- os/arch: windows/amd64
- go version: go1.12.3

rclone lsd "dateam:" --drive-trashed-only  
-1 2017-08-25 16:28:07 -1 Documents  
-1 2018-09-05 16:38:25 -1 Dropbox - DA  
-1 2018-11-15 16:44:39 -1 From Clients  
-1 2018-09-24 17:58:59 -1 Hardware Equipment  
-1 2018-02-28 16:35:34 -1 Notes  
-1 2018-02-28 16:35:03 -1 Shared  
-1 2018-10-05 17:38:59 -1 Shared Folders  
-1 2017-01-30 05:20:32 -1 Software  
-1 2017-09-20 09:47:21 -1 Software Crestron  
-1 2019-03-15 10:57:09 -1 Software Lutron  
-1 2019-02-05 09:27:30 -1 Software VPN  
-1 2019-02-19 13:27:46 -1 firmware  
-1 2018-03-06 10:31:15 -1 xPanels

The dateam: remote is a google team drive. It's trash is empty and when I ran the command it just lists the regular folder structure.

Same behaviour happens here:

rclone lsd "pyteam:" --drive-trashed-only  
-1 2017-01-30 16:11:12 -1 Archives  
-1 2017-06-17 16:53:16 -1 Secure

pyteam: is a regular google drive remote and it's trash is not empty yet the command only shows the regular folders.

---

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [July 31, 2019, 1:42pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/7 "2019-07-31T13:42:59Z")

</div>

Can you share a picture of the trash and what you are expecting to see so we can see what's different.

---

<div class="post-metadata">

**Author:** ![bulls23ant](https://forum.rclone.org/user_avatar/forum.rclone.org/bulls23ant/32/2416_2.png) [@bulls23ant](https://forum.rclone.org/u/bulls23ant)\
**Post date:** [July 31, 2019, 2:05pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/8 "2019-07-31T14:05:13Z")

</div>

Please see the attached screenshots:

 ![DA%20Team%20Drive%20rclone%20lsd](https://forum.rclone.org/uploads/default/original/2X/4/43bf085da821a380a732632e28619073fde8d8f0.png) ![DA%20Team%20Drive%20Regular%20Folder](https://forum.rclone.org/uploads/default/original/2X/2/2663f3d05a2cfaf228709d81704f00719d6b9314.png) ![DA%20Team%20Drive%20Trash](https://forum.rclone.org/uploads/default/original/2X/f/f8fcda14c87377ac35d83f79bec33a06f4cc5862.png)

---

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [July 31, 2019, 2:12pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/9 "2019-07-31T14:12:18Z")

</div>

Can you share the rclone.conf that goes along with it as well?

---

<div class="post-metadata">

**Author:** ![bulls23ant](https://forum.rclone.org/user_avatar/forum.rclone.org/bulls23ant/32/2416_2.png) [@bulls23ant](https://forum.rclone.org/u/bulls23ant)\
**Post date:** [July 31, 2019, 2:32pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/10 "2019-07-31T14:32:43Z")

</div>

[dateam]  
type = drive  
client\_id =  
client\_secret =  
scope =  
root\_folder\_id =  
service\_account\_file =  
token = {"access\_token":"TOKEN GOES HERE","token\_type":"Bearer","refresh\_token":"TOKEN GOES HERE","expiry":"2019-07-31T11:00:16.5234298-04:00"}  
team\_drive = TEAMDRIVEIDGOESHERE

---

<div class="post-metadata">

**Author:** ![thestigma](https://forum.rclone.org/user_avatar/forum.rclone.org/thestigma/32/3414_2.png) [@thestigma](https://forum.rclone.org/u/thestigma)\
**Post date:** [July 31, 2019, 2:38pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/11 "2019-07-31T14:38:14Z")

</div>

I will see if I can run a test to try and replicate the issue you are experiencing. Don't know if I will have the time today, but I'll tag this to remind me. I'm also on win10 and use google teamdrives so the setup should be basically identical (except I use the latest beta rather than stable 1.48).

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [July 31, 2019, 9:32pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/12 "2019-07-31T21:32:16Z")

</div>

> [@bulls23ant](#):
>
> The dateam: remote is a google team drive. It's trash is empty and when I ran the command it just lists the regular folder structure.

It will list the regular folder structure, just not the regular files... Deleted files are held in their original directories and rclone can't find them without showing all the directories. You shouldn't see any non trashed **files** in the listing.

---

<div class="post-metadata">

**Author:** ![bulls23ant](https://forum.rclone.org/user_avatar/forum.rclone.org/bulls23ant/32/2416_2.png) [@bulls23ant](https://forum.rclone.org/u/bulls23ant)\
**Post date:** [August 1, 2019, 1:05am UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/13 "2019-08-01T01:05:45Z")

</div>

I just ran some more tests and you are right of course. I tested the rclone delete commands combined with the --drive-trashed-only and --drive-use-trash=false and it did delete only the trashed items. I think my confusion was due to me running the rclone purge command combined with the --drive-trashed-only for a folder and it actually deleting non trashed items as well. I then recovered the items from trash and ran the delete command with the flag and it ended deleting what I had just recovered. Probably because google was slowly moving them back from trash. I guess the --drive-trashed-only flag doesn't apply to the purge command?

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [August 1, 2019, 1:11pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/14 "2019-08-01T13:11:19Z")

</div>

> [@bulls23ant](#):
>
> I guess the --drive-trashed-only flag doesn't apply to the purge command?

I just had a look at the code.

You are right, purge will trash everything in the directory regardless of whether it is trashed or not. It says to google "trash this directory" in a single call.

So using `--drive-trashed-only` with Purge is likely not to work as the user expects! What I can do is make Purge exit with an error if it is called with `--drive-trashed-only`. Can you please make a [new issue on github](https://github.com/ncw/rclone/issues/new/choose) about this and I'll make the fix - thanks!

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [October 30, 2019, 1:11pm UTC](https://forum.rclone.org/t/drive-trashed-only-weird-occurrence/11066/15 "2019-10-30T13:11:24Z")

</div>

Closed on October 30, 2019, 1:11pm UTC

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