# Rclone won't exit

**URL:** <https://forum.rclone.org/t/rclone-wont-exit/19067>\
**Category:** Help and Support\
**Created:** [September 12, 2020, 11:18am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067 "2020-09-12T11:18:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 12, 2020, 11:18am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/1 "2020-09-12T11:18:18Z")

</div>

#### What is the problem you are having with rclone?

Hi.. my rclone nightly jobs are suddenly NOT exiting..  
i get this for hours, until i kill the proc from the command line..

2020/09/12 13:00:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:01:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

my script looks like this  
#!/bin/bash

# rclone drive

_now=$(date +"%m_%d\_%Y")  
_file="/volume2/homes/rclonelog/logfile_$\_now.txt"  
rclone -v -c sync /volume2/Rackstation rack:RackStation --exclude-from "/volume2/homes/exclusion.txt" --config="/var/services/homes/admin/.config/rclone/rclone.conf" --log-file=$\_file --bwlimit "07:00,128 22:00,off"  
egrep -w 'Copied|Deleted' $\_file

i have no idea what has changed.. am i doing something stupid? thanks in advance. JP

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 12, 2020, 11:20am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/2 "2020-09-12T11:20:40Z")

</div>

edit -- i recently added the bandwidth restriction.. could that be it?

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 12, 2020, 11:23am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/3 "2020-09-12T11:23:31Z")

</div>

edit again -  
rclone version 1.52.1 running on synology RS2418rp+ to google drive

---

<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:** [September 12, 2020, 3:20pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/5 "2020-09-12T15:20:40Z")

</div>

What do the logs say?

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 12, 2020, 5:05pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/6 "2020-09-12T17:05:41Z")

</div>

2020/09/12 13:08:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:09:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:10:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:11:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:12:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:13:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:14:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:15:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:16:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:17:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

2020/09/12 13:18:50 INFO :  
Transferred: 81.001M / 81.001 MBytes, 100%, 35.543 kBytes/s, ETA 0s  
Checks: 84577 / 84577, 100%  
Deleted: 1  
Transferred: 15 / 15, 100%  
Elapsed time: 38m53.6s

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 12, 2020, 5:06pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/7 "2020-09-12T17:06:15Z")

</div>

it will repeat this forever..  
is there another log file i'm unaware of?  
thanks for your reply  
#JP

---

<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:** [September 12, 2020, 5:11pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/8 "2020-09-12T17:11:00Z")

</div>

Try adding -vv to see the debug log.

Also try the latest rclone if you aren't using it already.

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 13, 2020, 6:39am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/9 "2020-09-13T06:39:21Z")

</div>

ah.. i see the problem.. having deleted a bunch of stuff, rmdir is going through the whole lot and trying to delete directories that are no longer on the source, but failing due to trashed files, and things like Thumbs.db and @eaDir files lying around..  
is there a way to get rid of these pesky files?  
rclone -vv -c deletefile rack:Thumbs.db --config="/var/services/homes/admin/.config/rclone/rclone.conf" --dry-run  
didn't work

---

<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:** [September 13, 2020, 9:41am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/10 "2020-09-13T09:41:35Z")

</div>

Can you post the log that that command generated so I can see the problem?

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 13, 2020, 10:04am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/11 "2020-09-13T10:04:59Z")

</div>

```
                      2020/09/13 10:32:06 DEBUG : rclone: Version "v1.52.1" starting with parameters ["rclone" "-vv" "-c" "deletefile" "rack:Thumbs.db" "--config=/var/services/homes/admin/.config/rclone/rclone.conf" "--dry-run"]

```

2020/09/13 10:32:06 DEBUG : Using config file from "/var/services/homes/admin/.config/rclone/rclone.conf"  
2020/09/13 10:32:14 ERROR : Attempt 1/3 failed with 1 errors and: rack:Thumbs.db is a directory or doesn't exist  
2020/09/13 10:32:14 ERROR : Attempt 2/3 failed with 1 errors and: rack:Thumbs.db is a directory or doesn't exist  
2020/09/13 10:32:14 ERROR : Attempt 3/3 failed with 1 errors and: rack:Thumbs.db is a directory or doesn't exist  
2020/09/13 10:32:14 DEBUG : 4 go routines active  
2020/09/13 10:32:14 Failed to deletefile: rack:Thumbs.db is a directory or doesn't exist

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 13, 2020, 10:07am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/12 "2020-09-13T10:07:51Z")

</div>

it doesn't exist in the top level.. but i was hoping i was hoping for a recursive delete.. there must be hundreds of thousands of thumbs.db hidden in there

---

<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:** [September 13, 2020, 1:39pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/13 "2020-09-13T13:39:52Z")

</div>

You can use rclone purge for recursive delete. It works on directories not files.

Use -i for testing first!

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 14, 2020, 5:07am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/14 "2020-09-14T05:07:29Z")

</div>

i thought purge deleted everything! If i want to get fired I guess that might work. but i literally just want to get rid of empty directories, or rather directories with nothing in them but Thumbs.db. sync will do that for me once the directories are empty. however its not emptying them, even though they are no longer on the source, so i want to search through the entire google drive and delete any occurrences of Thumbs.db, rclone delete seems to search for a single directory in the root, and rclone deletefile looks for a file in the root only. rclone purge appears to delete the world out from under me.  
going through google drive and deleting with the gui is impossible

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 14, 2020, 5:55am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/15 "2020-09-14T05:55:17Z")

</div>

I guess the real question is why does rclone sync leave these files intact, after i've deleted from the source?

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 14, 2020, 7:03am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/16 "2020-09-14T07:03:00Z")

</div>

I have scoured all remaining thumbs from the source, though of course as the directories in question aren't in existence locally it's not going to make a difference. However, watching the log during the latest sync, i notice that rclone sync is excluding my specified files from the sync that are present on the remote rather than locally.  
2020/09/14 08:40:34 DEBUG : Departments/MEDICAL/.DS\_Store: Excluded  
2020/09/14 08:40:34 DEBUG : Departments/MEDICAL/Thumbs.db: Excluded  
2020/09/14 08:40:34 DEBUG : Departments/BRIDGE/.DS\_Store: Excluded  
2020/09/14 08:40:34 DEBUG : Departments/BRIDGE/@eaDir: Excluded  
2020/09/14 08:40:34 DEBUG : Departments/OFFICE/@eaDir: Excluded  
2020/09/14 08:40:34 DEBUG : Departments/OFFICE/.DS\_Store: Excluded  
2020/09/14 08:40:34 DEBUG : Departments/DECK/.DS\_Store: Excluded

this is confusing me.. i assumed exclusions were to prevent these files being uploaded to the remote destination, but they don't exist locally, so the exclusions must be checking the remote for these files.  
this might explain why they aren't getting deleted.. but its baffling me

---

<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:** [September 14, 2020, 9:44am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/17 "2020-09-14T09:44:26Z")

</div>

If you want things you excluded deleted then use `--delete-excluded`. This is another super dangerous flag so try first with `-i`!

```
  --delete-excluded Delete files on dest excluded from sync
```

---

<div class="post-metadata">

**Author:** ![awws](https://forum.rclone.org/user_avatar/forum.rclone.org/awws/32/7120_2.png) [@awws](https://forum.rclone.org/u/awws)\
**Post date:** [September 14, 2020, 11:30am UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/18 "2020-09-14T11:30:04Z")

</div>

@Talitha

I am having a similar rclone not exiting problem as well (though I am not really seeing errors). It looks _extremely_ similar to the issue you're having as well (though I am using fish shell). Is there anything about our environments that are similar? (I actually upgraded rclone manually but am still seeing the issue.).

(I seem not to be able to include links to posts in this forum, but it's titled as "Rclone not exiting on copy or sync (successful) to Dropbox crypt"

D.

D.

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 14, 2020, 1:32pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/19 "2020-09-14T13:32:51Z")

</div>

mine is exiting, but its taking a lot longer as theres so many empty dirs

---

<div class="post-metadata">

**Author:** ![Talitha](https://forum.rclone.org/user_avatar/forum.rclone.org/talitha/32/3852_2.png) [@Talitha](https://forum.rclone.org/u/Talitha)\
**Post date:** [September 14, 2020, 1:35pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/20 "2020-09-14T13:35:07Z")

</div>

that makes sense..  
i went through the source with a fine tooth comb and deleted the last of the pesky thumbs.db, then i removed it from the exclusion list and lo and behold all the dirs with thumbs in were wiped..  
i guess --delete-excluded does the same job.. I'll give it a try.  
thanks.  
meantime i';ll put thumbs back in the exclusion list, as i'll be generating more of course

---

<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:** [September 14, 2020, 1:52pm UTC](https://forum.rclone.org/t/rclone-wont-exit/19067/21 "2020-09-14T13:52:51Z")

</div>

Good glad you got it working 🙂

[Next page](https://forum.rclone.org/t/rclone-wont-exit/19067.md?page=2)
