But in the destination folder is an extra directory which I don't wish to have deleted, but it seems no matter what I put in the excludes file rclone wants to delete this folder. This directory is in the excludes.txt file.
Output Log
The output log doesn't have any DEBUG entries that are specific to the directory I am wanting to exclude from the sync, the log has the following as the last entry, entries further up in the list the sub directories.
2020-02-09 13:02:41 NOTICE: 1. D3 - Misc/1st - D4/3 - SCC.442 - Misc/4 - VMS: Not deleting as dry run is set
There are no DEBUG entries that are specific to the directory I am wanting to exclude, all the DEBUG enteries are merely stating that files in other directory have the same checksum.
I tried that but the problem remains, also I am doing a sync from one google drive to another google drive, and not local storage to google drive, is that why it's not working?
2020-02-09 13:59:24 NOTICE: D3 - Misc/1st - D4/3 - SCC.442 - Misc/4 - VMS: Not deleting as dry run is set
2020-02-09 13:59:24 DEBUG : Google drive root 'D1/D2': deleted 85 directories
So the testing directory seems to work, but when I go back to my real directory and have the exclude directory path from the end of the remote like in the working example, it is still wanting to delete the directory.
The directory I am wanting to exclude doesn't exist in the source google drive, but does in the destination google drive.
Edit.
@Animosity022 It seems the excludes file works only on the source google drive, so as to exclude that directory from being copied/moved/synced to the other google drive, which is great, but not what I need the destination has an extra directory in one of the directories that also is in the source, this directory however doesn't fit in the source google drive due to having only a 15GB space limit, so only exists in the destination google drive, and when I want to sync them rclone is wanting to delete the directory as it doesn't exist in the source folder.
I'm wanting to keep the contents of one drive (max 15GB space) synced with my GSuite drive, but a folder exists that is too large for the source google drive, and so this only exists in the destination, and sync is wanting to delete this folder.
@ncw I didn't try --create-empty-src-dirs but have just now, and the same problem exists in that it still wants to delete the folder in the destination.
It's a shame the excludes file wasn't able to be used for excluding both in the source and in the destination to prevent folders that don't exist from being deleted.
I just looked at the logs and in the first 10 lines this appears.
2020/02/15 07:08:36 DEBUG : Folder1/Folder2/Folder3/Folder4: Excluded from sync (and deletion)
But at the very end of the log this still appears as normal.
2020/02/15 07:08:54 NOTICE: Folder1/Folder2/Folder3/Folder4: Not deleting as dry run is set
Could you make a very small example of the problem? If you set up two local directories called src and dst then you should be able to make some files/directories in src and dst to demonstrate.
I tried this
.
├── dst
│ ├── dir
│ └── file1.txt
└── src
├── dir
│ └── file2.txt
└── file1.txt
With rclone sync --exclude "/dir/**" -vv src dst it didn't delete the dir directory on the dst so I obviously haven't quite understood your scenario yet.