Part of the Union doc doesn't seem to make sense

I've been using rclone for a few months now (it's great), and I was just now thinking about making my first union remote. So, I started reading the help doc on it, and quickly got to something that makes no sense to me. I feel like it's likely wrong, and I have a suspicion as to exactly how it's wrong, but I want to make sure that I understand. Also (assuming it's wrong) I just wanted to point it out so it can be fixed.

The fifth paragraph reads:

Subfolders can be used in upstream remotes. Assume a union remote named backup with the remotes mydrive:private/backup. Invoking rclone mkdir backup:desktop is exactly the same as invoking rclone mkdir mydrive2:/backup/desktop.

There are two things about this that I suspect are wrong about this:

(1) Pretty confident this first one is wrong: "mydrive2"? Where did that come from? I'm guessing either it should be "mydrive" or (more likely) the second sentence is just omitting the second remote in the union (and if not, then it shouldn't have the plural "remotes" anyway).

(2) What I think is wrong about the second depends on what exactly is wrong about the first:

(2a) If the "mydrive2" should be "mydrive", then wouldn't rclone mkdir backup:desktop be equivalent to rclone mkdir mydrive:private/backup/desktop? That is, in addition to "mydrive" rather than "mydrive2", an extra "private" that is seemingly missing from the help?

(2b) If, on the other hand, the definition of the union is supposed to describe both mydrive and mydrive2, then the "exactly the same as" should also describe both.

I am guessing that the paragraph really should read:

Subfolders can be used in upstream remotes. Assume a union remote named backup with the remotes mydrive:private/backup and mydrive2:backup. Invoking rclone mkdir backup:desktop is exactly the same as invoking rclone mkdir mydrive:private/backup/desktop and rclone mkdir mydrive2:/backup/desktop.

That is, rclone will create the desktop directory within both /private/backup (on mydrive) and /backup (on mydrive2). Am I understanding correctly? Thanks.

Similar apparent issues in the sixth paragraph, by the way.

Hmmm... I (think I) see now that I misunderstood what "Union" was for, and that it will only write to a single remote. So:

(1) In any case, I think those two paragraphs are messed up anyway, and should be fixed.

(2) Is there a way to accomplish what I was hoping to do? That is, a single rclone command to copy a file to two or more destinations? For example, say I have a file on my local drive called x.txt, and I want to copy it to both Remote1:Stuff/x.txt and Remote2:SomeDirectory/Stuff/x.txt. This is something that I currently do a lot (but for like five remotes, not two). So I'd like to have a way to define a remote Remotes1And2 which is defined as meaning both Remote1: and Remote2:SomeDirectory, and then simply:

rclone copy x.txt Remotes1And2:Stuff

Or, alternatively (but less preferred) a way to specify more than one target in rclone copy, like:

rclone copy x.txt Remote1:Stuff Remote2:SomeDirectory/Stuff

If the first route is taken (i.e. defining some remote like Remotes1And2), I understand that there might be complications with things like certain read operations. I'm really just looking for a way to write to multiple places in one simple command, and I don't care all that much about reading (with respect to this).

You can't copy to two remotes in a single command as you'd have to run two commands to accomplish that.

For writing to multiple remotes / all, you want to check out the all/epall policy:

Excellent, thanks.

The text given when creating a union in rclone config should be fixed too, then (in addition to the paragraphs in the help file mentioned above). Emphasis mine:

List of space separated remotes.
Can be 'remotea:test/dir remoteb:', '"remotea:test/space dir" remoteb:', etc.
The last remote is used to write to.
Enter a string value. Press Enter for the default ("").

That's where I got the idea that it will only write to a single remote. And that made the help doc paragraphs I originally mentioned seem like they made a little more sense.

I appreciate your confusion @rwv37 - I think the union docs need a re-write with a lot more examples. Just letting you know it is on the list!

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