Rclone sync including necessary folders VS excluding unnecessary ones


#1

Hello,
I came across with rclone v1.46 (go 1.11.5) issue which I don’t quite understand.

Setup: azureblob remote with backup of personal data, organized in folders:

user@microserver:~$ rclone lsd remote:current

              -1 2019-02-18 13:14:54        -1 VHDs
              -1 2019-02-18 13:14:54        -1 archive
              -1 2019-02-18 13:14:54        -1 distributives
              -1 2019-02-18 13:14:54        -1 ebooks
              -1 2019-02-18 13:14:54        -1 games
              -1 2019-02-18 13:14:54        -1 music
              -1 2019-02-18 13:14:54        -1 projects

I’m trying to sync my home server to this location. The structure of folders on homeserver is different:

user@microserver:~$ ls /mnt/raid/
VHDs  archive  backup  distributives  downloads  ebooks  games  music  nfs  settings  to.dfbackup2  video

so I have two options: to include only necessary folders or to exclude unnecessary ones.

First option:
rclone sync --dry-run /mnt/raid/ remote:current -Pv --include VHDs/** --include archive/** --include distributives/** --include ebooks/** --include games/** --include music/** --delete-excluded --backup-dir remote:20181222 --log-file rclone-include.log

Second one:
rclone sync --dry-run /mnt/raid remote:current -v --exclude backup/ --exclude downloads/ --exclude nfs/ --exclude settings/ --exclude to.dfbackup2/ --exclude video/ --delete-excluded --backup-dir remote:20181222 --log-file rclone-exclude.log

What I quite don’t understand is that they provide substantially different results of synchronization, e.g. number of transferred files for first option is 5979 and for second is 5529, during execution of “inclusive” command rclone tries to copy files which already exist on remote etc.

Any thoughts on what I’m doing or thinking wrong is highly appreciated. Also I would like to understand which option is preferred or correct one.

Thank you.

BR,
Denis


#2

Solved it.

Correct way to exclude 1st level folders is:

rclone sync --dry-run /mnt/raid remote:current -vv --exclude /backup/ --exclude /downloads/ --exclude /nfs/ --exclude /settings/ --exclude /to.dfbackup2/ --exclude /video/ --delete-excluded --backup-dir remote:20181222 --log-file rclone-exclude3.log

Now both commands produce the same result.