You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cli syntax: Multiple sources for single destination #4308
I am just saying that if you are claiming to be the rsync for cloud storage, I would expect to be as compatible as possible with rsync syntax. Otherwise people will use rclone/goofys only to mount the folder and continue using rsync which obviously has multiple downsides...
I think that was an old line that was removed as it was confusing for me as well as rclone is not rsync and doesn't plan to be.
The goal does not seem to be equivalent rsync commands. If you check the updated pages, please let us know if something seems. off still as rclone.org has been updated recently with changes to prevent those confusing things.
When moving from traditional network shares (samba, nfs, ...) to cloud storage (S3, Minio, Backblaze), I was looking for a replacement of rsync to accomplish the same things (copy files and folders reliably and easily) in the cloud domain. The more I learn about rclone, the more complicated it becomes (you have seen the other issues I opened)... I just want to copy some files! Maybe rclone is not the right tool for this task...
rclone copy should allow multiple source arguments and a single destination argument like rsync, mv, ...
This would work nicely for local to remote copies. It wouldn't work at all for remote to local copies though as if the shell is interpreting the globs then it won't know how to interpret them for a remote
rclone copy *.jpg drive: # could be made to work
rclone copy drive:*.jpg . # won't work
I could make the source files understand globbing so you'd write
rclone copy "*.jpg" drive: # could be made to work
rclone copy "drive:*.jpg" . # won't work
Multiple sources for copy would be relatively easy but all the source files would have to be limited to the same backend.... Maybe even limited to the local disk.
This is why I named the issue "multiple sources" and not "shell globbing". So I think it would be perfectly fine to just allow multiple sources. For remote wildcards, one can use the --include filter. If it is limited to a single backend, this is also fine when a comprehensible error message is shown when different backends are specified...
Currently rclone treats metacharacters (*?) in source file name as part of the name, while in source filter arguments (--include --exclude) they are treated as globs. Changing this behavior would break existing scripts.
UPD: It's even more tricky. If rclone is run interactively on a Windows(powershell) or Unix(bash/*sh) command line but source argument is located on a remote, user must properly escape metachars to prevent shell globbing (and let rclone do the remote listing and globbing/filtering and apply many other filtering options). If source is local then shell globbing would be probably ok, but rclone would have to reparse command line (some verbs require more arguments than just source and destination).
The only solution I can see is a new flag like --source-is-filter. The flag is probably meaningful for copy move sync delete commands, meaningless for copyto and many others. It needs more investigation, looks like a pretty large task.
I tend to agree with @ncw, keep copy/move behavior as is and introduce unix-like cp/mv verbs.
Activity
animosity022 commentedon Jun 5, 2020
That already exists via the filtering as a directory is normally the source until you want to move a single file.
Can you give an example of what you'd want to happen if I'm not understanding it?
darkdragon-001 commentedon Jun 6, 2020
I want multiple directories or files
Should copy
folder/prefixand/folder/prefix_something, but fails with the message that only two non-flag arguments are allowed, but three given.animosity022 commentedon Jun 6, 2020
You can already do that with include / filters.
Example would be:
darkdragon-001 commentedon Jun 6, 2020
Thanks for your example of using include/filters!
I am just saying that if you are claiming to be the
rsyncfor cloud storage, I would expect to be as compatible as possible with rsync syntax. Otherwise people will use rclone/goofys only to mount the folder and continue using rsync which obviously has multiple downsides...animosity022 commentedon Jun 6, 2020
I think that was an old line that was removed as it was confusing for me as well as rclone is not rsync and doesn't plan to be.
The goal does not seem to be equivalent rsync commands. If you check the updated pages, please let us know if something seems. off still as rclone.org has been updated recently with changes to prevent those confusing things.
darkdragon-001 commentedon Jun 6, 2020
Maybe a migration guide would be helpful then, which rsync commands/flags translate to which rclone ones...
animosity022 commentedon Jun 6, 2020
That feels like quite a rabbit hole to go down as rsync is very different from rclone in how it works and what it does imo.
That doesn't feel maintainable to me as it's hard enough to keep just documentation clean and up to date.
Perhaps @ncw and @calisro and @darthShadow can chime and share their feedback or something like that.
darkdragon-001 commentedon Jun 6, 2020
When moving from traditional network shares (samba, nfs, ...) to cloud storage (S3, Minio, Backblaze), I was looking for a replacement of rsync to accomplish the same things (copy files and folders reliably and easily) in the cloud domain. The more I learn about rclone, the more complicated it becomes (you have seen the other issues I opened)... I just want to copy some files! Maybe rclone is not the right tool for this task...
darkdragon-001 commentedon Jun 6, 2020
I am closing the issue since it seems to be intended behavior.
ncw commentedon Jun 8, 2020
This would work nicely for local to remote copies. It wouldn't work at all for remote to local copies though as if the shell is interpreting the globs then it won't know how to interpret them for a remote
I could make the source files understand globbing so you'd write
And rclone would convert that to
Multiple sources for
copywould be relatively easy but all the source files would have to be limited to the same backend.... Maybe even limited to the local disk.darkdragon-001 commentedon Jun 8, 2020
This is why I named the issue "multiple sources" and not "shell globbing". So I think it would be perfectly fine to just allow multiple sources. For remote wildcards, one can use the
--includefilter. If it is limited to a single backend, this is also fine when a comprehensible error message is shown when different backends are specified...ncw commentedon Jun 10, 2020
What do you think about the multiple sources being limited to the local disk? Is that too limiting?
14 remaining items
ivandeex commentedon Nov 16, 2020
From #1426 (comment)
Currently rclone treats metacharacters (
*?) in source file name as part of the name, while in source filter arguments (--include --exclude) they are treated as globs. Changing this behavior would break existing scripts.UPD: It's even more tricky. If rclone is run interactively on a Windows(powershell) or Unix(bash/*sh) command line but source argument is located on a remote, user must properly escape metachars to prevent shell globbing (and let rclone do the remote listing and globbing/filtering and apply many other filtering options). If source is local then shell globbing would be probably ok, but rclone would have to reparse command line (some verbs require more arguments than just source and destination).
The only solution I can see is a new flag like
--source-is-filter. The flag is probably meaningful forcopy move sync deletecommands, meaningless forcopytoand many others. It needs more investigation, looks like a pretty large task.I tend to agree with @ncw, keep copy/move behavior as is and introduce unix-like cp/mv verbs.
ivandeex commentedon Mar 31, 2021
@ncw @darkdragon-001
We agree that using filters is not enough.
This request will be implemented by the new
cp,mv,rsynccommands (tickets #4777 and #4776).All valid requirements have been copied over to #4777
@darkdragon-001
Please subscribe to the new ticket.
As it is quite tricky to replicate the features of cp/mv we can't provide ETA yet.
ivandeex commentedon Mar 31, 2021
I am going to close this as all requirements are collected in #4777