Rclone sync does not delete files on destination when excluded on source

What is the problem you are having with rclone?

When using rclone sync A B --exclude="/C" it does not remove C on the destination B even though C exists on B.

I'm trying to sync a backup drive to Google Drive, and forgot to exclude the minio-0 directory. After exclude minio-0 directory, rclone does not remove that directory on the destination.

Run the command 'rclone version' and share the full output of the command.

rclone v1.50.2
- os/arch: linux/amd64
- go version: go1.13.6

Which cloud storage system are you using? (eg Google Drive)

Source: Local Disk
Destination: Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync -v /Five gdrive:/Data/Backup/Five --exclude="/lost+found/**" --exclude="/minio-*/**"

The rclone config contents with secrets removed.

type = drive
client_id =
client_secret =
token = ***
root_folder_id = ***

A log from the command with the -vv flag

2022/01/06 12:26:41 DEBUG : rclone: Version "v1.50.2" starting with parameters ["rclone" "sync" "-vv" "/Five" "gdrive:/D
ata/Backup/Five" "--exclude=/lost+found/**" "--exclude=/minio-*/**"]                                                    
2022/01/06 12:26:41 DEBUG : Using config file from "/home/tuananh/.rclone.conf"                                         
2022/01/06 12:26:42 DEBUG : minio-0: Excluded                                                                           
2022/01/06 12:26:42 DEBUG : lost+found: Excluded
2022/01/06 12:26:43 INFO  : Google drive root 'Data/Backup/Five': Waiting for transfers to finish
2022/01/06 12:26:43 INFO  : Waiting for deletions to finish
2022/01/06 12:26:43 INFO  : 
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 0
Checks:                47 / 47, 100%
Transferred:            0 / 0, -
Elapsed time:          0s

2022/01/06 12:26:43 DEBUG : 10 go routines active
2022/01/06 12:26:43 DEBUG : rclone: Version "v1.50.2" finishing with parameters ["rclone" "sync" "-vv" "/Five" "gdrive:/
Data/Backup/Five" "--exclude=/lost+found/**" "--exclude=/minio-*/**"]

That’s a really old version.

If you exclude it, it’s excluded and I would not expect it to do anything with it since you specified to exclude it.

hi, if this is a one-time mistake, perhaps delete the dest folder and move on.

filters work on the source, not the dest.
by default, if a file is excluded from the source, then rclone will not delete that corresponding file in the dest.

if you want rclone to delete excluded files then might try

YES!!! This is the exact flag I am looking for. Thank you for the hint!

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