Repository navigation
Open
Labels
Milestone
Description
What is the problem you are having with rclone?
Both switches are listed on the copyto doc page, but result in a Can't limit to single files when using filters error. The copyto doc does say This doesn’t transfer unchanged files, testing by size and modification time or MD5SUM. The doc inconsistency or code bug may apply to other similar commands.
For rclonesync, I'm working on a filtering solution for Google Doc files, and inadvertently ran into this error. file1.txt is a zero-length files that I do want to be copied with --min-size 0.
$ /bin/rclone copyto GDrive:/Exchange/file1.txt /path/file1.txt --filter-from /path/Filters --verbose
2018/07/29 11:57:51 Can't limit to single files when using filters: GDrive:/Exchange/file1.txt
$ /bin/rclone copyto GDrive:/Exchange/file1.txt /path/file1.txt --verbose --min-size 0
2018/07/29 11:59:27 Can't limit to single files when using filters: GDrive:/Exchange/file1.txt
$ /bin/rclone copyto GDrive:/Exchange/file1.txt /path/file1.txt --verbose
2018/07/29 11:59:42 INFO : file1.txt: Copied (new)
2018/07/29 11:59:42 INFO :
Transferred: 0 Bytes (0 Bytes/s)
Errors: 0
Checks: 0
Transferred: 1
Elapsed time: 2s
My Filters file contains:
# Dropbox wont sync some files, so filtered here. See https://www.dropbox.com/en/help/syncing-uploads/files-not-syncing
- .dropbox.attr
- ~*.tmp
- ~$*
- .~*
- desktop.ini
- .dropbox
# Used for rclonesync testing, so excluded from normal runs
- /testdir/**
What is your rclone version (eg output from rclone -V)
$ /bin/rclone -V
rclone v1.42
- os/arch: linux/amd64
- go version: go1.10.1
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Centos 7, 64-bit
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)
rclone copyto
A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)
above
Activity
ncw commentedon Jul 31, 2018
I can fix it so that
rclone copyto file1 file2works.Would you expect that to obey the filters too? So if you put
--min-size 0then it wouldn't copy a zero sized file?I guess I can do that too.
cjnaz commentedon Jul 31, 2018
Per the doc,
copytoandmovetosupport single file or directory copies/moves. Having filtering honored (--include/--exclude/--filter, including -from versions) in the directory case make sense. Is the error message in the OP only in the case of requesting to copy a single file, when the filter also excludes it? I think that If the directory copyto case accepts the filter then the single file case could/should work the same, without an error. As is, script code using rclone would need to handle the case where the file being copied may conflict with the filter. Messy. Having filtering work the same for copy/copyto/move/moveto as with sync seems to be clean. You certainly have the bigger picture for what other problems this may cause.For --min-size, I was experimenting for how to filter Google Docs from my copies. --include/--exclude/--filter wouldn't do it since name filtering can't detect a Google Doc. I was trying to use --min-size, which is also not accepted on copyto/moveto, and perhaps other commands. For rclonesync.py, I currently have a --min-size 0 jammed in there to prevent errors if the Path1 is a Drive and there are Google Docs on the drive.
I was experimenting with
rclone lsl --min-size, and I think this works correctly as is. The size value is inclusive.--min-size 0bdoes list zero length files and not Google docs. Don't change this. :> --min-size and --max-size should be inclusive.Bottom line: Allow/support all sorts of filtering on single file copyto/moveto commands, and perhaps others you would be aware of in this context.
ncw commentedon Aug 1, 2018
The way that the single file stuff works is that it puts in a list of files with a single file in that rclone will use and this is incompatible with adding other filters.
Though this could be fixed now I come to think about it.
BTW you can filter google docs out with
--drive-skip-gdocs...OK!
daed-alus commentedon Feb 17, 2023
is this worked on? its very annoying to not be able to use filters with the copyto command