Copying multiple sources to one dest w/ --include-from and deleting from dest w/ --delete-excluded

What is the problem you are having with rclone?

I'm trying to copy several source trees into one destination, that is copying the content of dir1, dir2 and dir3 into remote:dir. Also I want to delete from remote:dir any file that is no longer present in either dir1 or dir2 or dir3. To do so, I'm doing

See below

Since --include-from implies a - ** (exclude anything) at the end of the list, I thought that combined with --delete-excluded it would work, but it doesn't. In fact, if I remove file1 from dir1 and re-run the commands above, I still see file1 in remote:dir.

How can I do that?

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

rclone v1.64.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 6.2.0-34-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.1
  • go/linking: static
  • go/tags: none

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

Google Drive

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

fileList="$(find dir1 -type f -printf '%f\n')" # prints only basename
fileList+=$'\n'
fileList="$(find dir2 -type f -printf '%f\n')"
fileList+=$'\n'
fileList="$(find dir3 -type f -printf '%f\n')"
fileList+=$'\n'
rclone -P copy dir1  remote:dir --include-from - --delete-excluded <<<"$fileList"
rclone -P copy dir2  remote:dir --include-from - --delete-excluded <<<"$fileList"
rclone -P copy dir3  remote:dir --include-from - --delete-excluded <<<"$fileList"

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[gdrive]
type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX
team_drive = 

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