Connecting two Remote Volumes

Hello, I'm wondering if it is possible to connect two remote mounts via rclone so that one sees the other in its filesystem. For example, I want to make my Google Drive available to a remote SFTP mount. I mounted the SFTP remote first, and then tried to mount Google Drive in a directory within that SFTP remote but it didn't work. I didn't get an error but the folders weren't there. Any ideas? Is this possible?

I am trying to relay files from one server to the other without having to move them to my relay server and then move them again. If they could just go by themselves, that'd be great.

What is your rclone version (output from rclone version)

rclone v1.51.0

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 20.04 Server

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

SFTP and Google Drive

Command?

rclone mount sftp:/remote/dir /home/dir1/
then
rclone mount drive:/remote/dir /home/dir1/dir2

Thank you for your time!

When mount something over something else, you hide what's underneath it so it's not really something that most folks do.

You can sync two remotes to keep them up to date.

hello and welcome to the forum,
not sure exactly what you are trying to do but perhaps this will spark some ideas.

you could use a union remote
https://rclone.org/union/

I wouldn't do what you're asking but you can use bind mounts. You can end up with doing unexpected things (putting things in the wrong mounts) Perhaps read only mounts would be better.

root@dell-rob:~# mkdir a
root@dell-rob:~# mkdir b
root@dell-rob:~# sudo rclone mount zonegd: a &
[1] 31121
root@dell-rob:~# sudo rclone mount zonegd: b &
[2] 31135
root@dell-rob:~# 
root@dell-rob:~# mkdir dir1
root@dell-rob:~# mount --bind a dir1
root@dell-rob:~# mkdir dir1/dir2 && mount --bind b dir1/dir2
root@dell-rob:~# ls dir1
cloudp  cloudp-bkup  dir2
root@dell-rob:~# cd dir1/
root@dell-rob:~/dir1# ls dir2
cloudp  cloudp-bkup  dir2

what the heck is that? some kind of torture device?
geez, there is always some new way to use a flag

as per the docs
--bind is "Local address to bind to for outgoing connections"

can you please explain, inquiring minds want to know?

1 Like

" A bind mount is an alternate view of a directory tree. Classically, mounting creates a view of a storage device as a directory tree. A bind mount instead takes an existing directory tree and replicates it under a different point. The directories and files in the bind mount are the same as the original. Any modification on one side is immediately reflected on the other side, since the two views show the same data."

1 Like

ok, i got confused, i understand now, thanks

It could become a torture device if you did what I did above. :joy: where dir2 -> dir2 -> dir2 -> infinity.

Thank you! I think a Union mount will do the trick. I'll play around with it.

On second thought (sorry for the double post), I don't think union is what I wanted, or maybe I've just misconfigured it.

Basically I'm trying to move files and folders automatically from one remote to another. Is there a watch folder functionality or something that could accomplish this?

There isn't. You can run it on an interval and it would copy only what has changed.

Could more than one copy command be running at the same time for the same folder? Any idea about the best way to go about it? A Cron Job?

Let's say I setup a rclone copy command to run on the same folder every 10 minutes, it would only move new files and folders within it? And not conflict with any of the other rclone copy commands?

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