rclone copy

Copy files from source to dest, skipping identical files.

Synopsis

Copy the source to the destination. Does not transfer files that are identical on source and destination, testing by size and modification time or MD5SUM. Doesn’t delete files from the destination. If you want to also delete files from destination, to make it match source, use the sync command instead.

Note that it is always the contents of the directory that is synced, not the directory itself. So when source:path is a directory, it’s the contents of source:path that are copied, not the directory name and contents.

To copy single files, use the copyto command instead.

If dest:path doesn’t exist, it is created and the source:path contents go there.

For example

  1. rclone copy source:sourcepath dest:destpath

Let’s say there are two files in sourcepath

  1. sourcepath/one.txt
  2. sourcepath/two.txt

This copies them to

  1. destpath/one.txt
  2. destpath/two.txt

Not to

  1. destpath/sourcepath/one.txt
  2. destpath/sourcepath/two.txt

If you are familiar with rsync, rclone always works as if you had written a trailing / - meaning “copy the contents of this directory”. This applies to all commands and whether you are talking about the source or destination.

See the --no-traverse option for controlling whether rclone lists the destination directory or not. Supplying this option when copying a small number of files into a large destination can speed transfers up greatly.

For example, if you have many files in /path/to/src but only a few of them change every day, you can copy all the files which have changed recently very efficiently like this:

  1. rclone copy --max-age 24h --no-traverse /path/to/src remote:

Rclone will sync the modification times of files and directories if the backend supports it. If metadata syncing is required then use the --metadata flag.

Note that the modification time and metadata for the root directory will not be synced. See https://github.com/rclone/rclone/issues/7652 for more info.

Note: Use the -P/--progress flag to view real-time transfer statistics.

Note: Use the --dry-run or the --interactive/-i flag to test without copying anything.

  1. rclone copy source:path dest:path [flags]

Options

  1. --create-empty-src-dirs Create empty source dirs on destination after copy
  2. -h, --help help for copy

Options shared with other commands are described next. See the global flags page for global options not listed here.

Copy Options

Flags for anything which can copy a file

  1. --check-first Do all the checks before starting transfers
  2. -c, --checksum Check for changes with size & checksum (if available, or fallback to size only)
  3. --compare-dest stringArray Include additional server-side paths during comparison
  4. --copy-dest stringArray Implies --compare-dest but also copies files from paths into destination
  5. --cutoff-mode HARD|SOFT|CAUTIOUS Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default HARD)
  6. --ignore-case-sync Ignore case when synchronizing
  7. --ignore-checksum Skip post copy check of checksums
  8. --ignore-existing Skip all files that exist on destination
  9. --ignore-size Ignore size when skipping use modtime or checksum
  10. -I, --ignore-times Don't skip items that match size and time - transfer all unconditionally
  11. --immutable Do not modify files, fail if existing files have been modified
  12. --inplace Download directly to destination file instead of atomic download to temp/rename
  13. -l, --links Translate symlinks to/from regular files with a '.rclonelink' extension
  14. --max-backlog int Maximum number of objects in sync or check backlog (default 10000)
  15. --max-duration Duration Maximum duration rclone will transfer data for (default 0s)
  16. --max-transfer SizeSuffix Maximum size of data to transfer (default off)
  17. -M, --metadata If set, preserve metadata when copying objects
  18. --modify-window Duration Max time diff to be considered the same (default 1ns)
  19. --multi-thread-chunk-size SizeSuffix Chunk size for multi-thread downloads / uploads, if not set by filesystem (default 64Mi)
  20. --multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 256Mi)
  21. --multi-thread-streams int Number of streams to use for multi-thread downloads (default 4)
  22. --multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki)
  23. --no-check-dest Don't check the destination, copy regardless
  24. --no-traverse Don't traverse destination file system on copy
  25. --no-update-dir-modtime Don't update directory modification times
  26. --no-update-modtime Don't update destination modtime if files identical
  27. --order-by string Instructions on how to order the transfers, e.g. 'size,descending'
  28. --partial-suffix string Add partial-suffix to temporary file name when --inplace is not used (default ".partial")
  29. --refresh-times Refresh the modtime of remote files
  30. --server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs
  31. --size-only Skip based on size only, not modtime or checksum
  32. --streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
  33. -u, --update Skip files that are newer on the destination

Important Options

Important flags useful for most commands

  1. -n, --dry-run Do a trial run with no permanent changes
  2. -i, --interactive Enable interactive mode
  3. -v, --verbose count Print lots more stuff (repeat for more)

Filter Options

Flags for filtering directory listings

  1. --delete-excluded Delete files on dest excluded from sync
  2. --exclude stringArray Exclude files matching pattern
  3. --exclude-from stringArray Read file exclude patterns from file (use - to read from stdin)
  4. --exclude-if-present stringArray Exclude directories if filename is present
  5. --files-from stringArray Read list of source-file names from file (use - to read from stdin)
  6. --files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin)
  7. -f, --filter stringArray Add a file filtering rule
  8. --filter-from stringArray Read file filtering patterns from a file (use - to read from stdin)
  9. --ignore-case Ignore case in filters (case insensitive)
  10. --include stringArray Include files matching pattern
  11. --include-from stringArray Read file include patterns from file (use - to read from stdin)
  12. --max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
  13. --max-depth int If set limits the recursion depth to this (default -1)
  14. --max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
  15. --metadata-exclude stringArray Exclude metadatas matching pattern
  16. --metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin)
  17. --metadata-filter stringArray Add a metadata filtering rule
  18. --metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin)
  19. --metadata-include stringArray Include metadatas matching pattern
  20. --metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin)
  21. --min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
  22. --min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)

Listing Options

Flags for listing directories

  1. --default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
  2. --fast-list Use recursive list if available; uses more memory but fewer transactions

See Also

  • rclone - Show help for rclone commands, flags and backends.