Rclone copy and --exclude

What is the problem you are having with rclone?

It's more of a question than a problem. I'm looking to exclude samples (all files that contain the word sample) from rclone copy, but then after the copy process is finished I want rclone to delete all the excluded files from the source. I don't know if --delete-excluded is the flag that I'm looking for.

What is your rclone version (output from rclone version)


Which OS you are using and how many bits (eg Windows 7, 64 bit)


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


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

rclone copy --log-level ${LOG_LEVEL} --delete-empty-src-dirs --stats 120s --buffer-size 128M --drive-chunk-size 128M --use-mmap --timeout 1m --exclude *sample*

I guess this is the simplest you can do:

rclone copy src: dst: --exclude '*sample*'
rclone delete src: --include  '*sample*'

It may be quicker to do the delete before the copy, if you have many sample files.

Please use caution with irreversible delete commands, use --dry-run to test first.

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