How do I limit the number of files to copy/move?

I can't find a flag for this, so maybe its not possible or im just blind :slight_smile:

What is the problem you are having with rclone?

I want to copy/move only 1 file. I want rclone to stop successfully after the first file is copied.

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

rclone v1.57.0

  • os/version: Microsoft Windows 10 Pro 2009 (64 bit)
  • os/kernel: 10.0.19042.1466 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.17.2
  • go/linking: dynamic
  • go/tags: cmount

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


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

I have tried with --max-duration 2s but it seems to stop the first one also.
I have also tried with --max-backlog=1 but it doesnt seem to work, it starts to upload more after the first is done.
This is what I'm doing currently:

rclone copy E:/OBS-recordings dropbox:/OBS-recordings --max-backlog=1 --transfers=1 -P

It started at 0/3 but after the first was uploaded it went to 1/4.

λ rclone copy E:/OBS-recordings dropbox:/OBS-recordings-upload --max-backlog=1 --transfers=1 -P
Transferred:        6.627 GiB / 25.663 GiB, 26%, 9.449 MiB/s, ETA 34m22s
Transferred:            1 / 4, 25%
Elapsed time:     11m31.1s

You want

--transfers 1


--max-transfer 1k

or something along those lines.

I already have set transfers 1 .

And max-transfer 1k doesnt work either:
Failed to copy with 2 errors: last error was: Max transfer limit reached as set by --max-transfer

So I probably have to use a script to get the first filename in the folder and just copy that... Its not possible only via rclone?

I can't see your screen so you gotta share what you ran and output..

Along with 1 and max, you need to change the cutoff mode as it changed to hard which stops things. You want soft.

rclone copy /home/felix/test /home/felix/test2 --transfers 1 --max-transfer 1b --cutoff-mode soft -vvv
2022/01/25 15:19:14 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/01/25 15:19:14 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "copy" "/home/felix/test" "/home/felix/test2" "--transfers" "1" "--max-transfer" "1b" "--cutoff-mode" "soft" "-vvv"]
2022/01/25 15:19:14 DEBUG : Creating backend with remote "/home/felix/test"
2022/01/25 15:19:14 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/01/25 15:19:14 DEBUG : Creating backend with remote "/home/felix/test2"
2022/01/25 15:19:14 DEBUG : Local file system at /home/felix/test2: Waiting for checks to finish
2022/01/25 15:19:14 DEBUG : Local file system at /home/felix/test2: Waiting for transfers to finish
2022/01/25 15:19:14 DEBUG : one: md5 = e7ba1f0cbdc5dcd59c3fb47089634983 OK
2022/01/25 15:19:14 INFO  : one: Copied (new)
2022/01/25 15:19:14 NOTICE: Max transfer limit reached as set by --max-transfer - stopping transfers
2022/01/25 15:19:14 ERROR : Can't retry any of the errors - not attempting retries
2022/01/25 15:19:14 INFO  :
Transferred:   	        153 B / 306 B, 50%, 0 B/s, ETA -
Errors:                 2 (no need to retry)
Transferred:            1 / 2, 50%
Elapsed time:         0.0s


Thanks it works now using --cutoff-mode soft

1 Like

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