mmozeiko / RcloneBrowser

Simple cross platform GUI for rclone
https://mmozeiko.github.io/RcloneBrowser
The Unlicense
1.32k stars 418 forks source link

Rclone Browser inserting extra folder name in Destination path #22

Open howardm opened 7 years ago

howardm commented 7 years ago

Hi,

When I select a source folder to sync to a particular remote folder, an extra /[folder name] is inserted in the Destination path. See the attached screenshot below


rclonebrowsererror


Am I doing something wrong ?

Thanks.

Howard

mmozeiko commented 7 years ago

The idea is that you need to select parent folder in remote when uploading folder. So it behaves exactly the same when you select files to upload.

So if you select "local/a.txt" file, and "remote:dst/WebReceipts" folder, it will upload a.txt file to "dst/WebReceipts/a.txt". For folder it would be same - if you select "local/WebReceipts" folder to upload to "remote:dst/WebReceipts", then it will put it inside - to "dst/WebReceipts/WebReceipts".

You need to select only "dst" folder, when uploading folders. Basically always select parent folder where you want to upload file or folder.

If I would made "local/WebReceipts" folder to be uploaded to "dst/WebReceipts". Then you would not be able to select in GUI to upload to /WebReceipts folder if it doesn't exsit. Because destination would look like "remote:" or "remote:/" and it would put contents of "local/WebReceipt/*" inside "/" root folder.

howardm commented 7 years ago

I understand this now. I did not understand this when I first started with Rclone. I think most users might do what I did.

After the initial configuration, I started by creating two folders:laptop and laptopcrypt. In Google Drive, I saw these two empty folders.

I then created a Crypt, designating laptopcrypt as its Parent Folder.

Let's say I then decide to create three folders in laptopcrypt in order to "replicate" certain named folders I have on my laptop, the contents of which I want to encrypt and upload. I then have, as an example:


laptop laptopcrypt ---Folder X
       ---Folder Y
       |
       ---Folder Z

I then 1) select Folder X in Rclone Browser, and 2) navigate to and select Folder X on my laptop.

Now I will end up with: /laptopcrypt/Folder X/Folder X

The first Folder X in this hierarchy [path] is superfluous.


In this way, a first-time user may not easily understand how to avoid creating the superfluous Folder X, etc.


Now, you say above:

"If I would made "local/WebReceipts" folder to be uploaded to "dst/WebReceipts". Then you would not be able to select in GUI to upload to /WebReceipts folder if it doesn't exsit. Because destination would look like "remote:" or "remote:/" and it would put contents of "local/WebReceipt/*" inside "/" root folder."

Is it not the case that if I select local/WebReceipts folder on my laptop, and that folder does not yet exist in the / folder, then Rclone will first create it, and then upload the contents into it ?

Howard

mmozeiko commented 7 years ago

Yes, it will create /WebReceipts if it does not exit.

If you select folder remote "/dst/W" and then locally select "local/A", I will upload it to "remote/W/A" (creating new one if it doesn't exist yet). If you would select remote "/" and then localy "local/A" I'll upload it to "/A".

Qrrbrbirlbel commented 7 years ago

This surprised me the first time, too. Using OP's example, I now remove the added WebReceipts part before running the command because the folder on my remote destination is actually called _WebReceipts (and, obviously, I don't want _WebReceipts/WebReceipts).

The confusing part is that—for me—it is not the expected behavior. With rclone you do

rclone copy /Users/howardm/WebReceipts googledrive:laptop/_WebReceipts

and rclone does not create a _WebReceipts/WebReceipts folder. And indeed, rCloneBrowser calls

rclone copy /Users/howardm/WebReceipts googledrive:laptop/_WebReceipts/WebReceipts

Would adding another checkbox that toggles thig behavior be too much work?

mmozeiko commented 7 years ago

Adding new checkbox is not much work. But maintaining it is. And having more cluttered UI it never a good UI.

Actually if you start from scratch, then this works exactly as you expect. Imagine empty remote. Only place to upload is root /. So you select /, and then press "Upload" and select local/WebReceipts folder. UI will show that it will go to /WebReceipts and that's exactly what you usually want.

howardm commented 7 years ago

Hi,

Isn't some of the confusion here (well, at least my initial confusion) because of these statements at rclone.org:


For copy

Note that it is always the contents of the directory that is synced, not the directory so when source:path is a directory, it’s the contents of source:path that are copied, not the directory name and contents.

If dest:path doesn’t exist, it is created and the source:path contents go there.

And

If you are familiar with rsync, rclone always works as if you had written a trailing / - meaning “copy the contents of this directory”. This applies to all commands and whether you are talking about the source or destination.

And

For sync

It is always the contents of the directory that is synced, not the directory so when source:path is a directory, it’s the contents of source:path that are copied, not the directory name and contents. See extended explanation in the copy command above if unsure.

If dest:path doesn’t exist, it is created and the source:path contents go there.


So a user of Rclone Browser will need to understand this. Perhaps this will have to be "explained" somehow in the UI or instructions.

Howard

mmozeiko commented 7 years ago

Agreed. I will need to improve this in UI. I was thinking to add text below Source and Destination fields. When you select both of them, then UI will show something like "This will copy src/folderA into remote:dst/whatever/folderA" or similar.

howardm commented 7 years ago

Hi,

Here is something to consider:

These are two scenarios when a user is working with a directory- not a file(s)— and has stipulated the Copy command.

Scenario one:

The user has selected the root directory of Destination and is uploading the contents of a Source directory CVs ( a corresponding directory not previously created in Destination).


scenarioone


Note the message displayed.

Scenario two: The user has selected an existent directory in Destination and is uploading the contents of a Source directory into it.


scenariotwo


Note: the extra directory in the Destination path should not be created, and a different message displayed.

What do you think ? Is my understanding of Rclone and current Rclone Browser correct ?

Is this doable from a coding perspective ?

Howard

mmozeiko commented 7 years ago

Let's say that you have selected googledrive:laptop/WebReceipts folder in GUI, and then locally you select /Users/howardm/FooBar. Do you want to upload folder FooBar to googledrive:laptop/WebReceipts (so you will have (googledrive:laptop/WebReceipts/FooBar)? Or do you want to contents of FooBar inside googledrive:laptop/WebReceipts folder (like in your 2nd screenshot)? If latter, how do I upload FooBar inside WebReceipts? There is nothing to select in GUI, because FooBar doesn't exist yet. So you will need to type it manually in Destination field. This is the reason why it automatically appends folder name of source to destination field.

howardm commented 7 years ago

Let's say that you have selected googledrive:laptop/WebReceipts folder in GUI, and then locally you select /Users/howardm/FooBar. Do you want to upload folder FooBar to googledrive:laptop/WebReceipts (so you will have (googledrive:laptop/WebReceipts/FooBar)?

Ah, no. Because I'm primarily using Google Drive for backups, I want /Users/howardm/FooBar to go into laptop as a separate directory.

Or do you want to contents of FooBar inside googledrive:laptop/WebReceipts folder (like in your 2nd screenshot)?

No. :-)

O.K., here are two methods— the first incorrect; the second correct— for my purpose here:


wrongmethod


propermethod


My first inclination— because I was syncing the WebReceipts folder after I had changed (added; deleted) files within over time— was to immediately select the WebReceipts folder. That's the mistake, right ?

Now that I think I understand Rclone and Rclone Browser, the present UI is just fine :-)

You may perhaps want to consider adding basic instructions and a few examples in a README or an enclosed INSTRUCTIONS file in your installation package.

Cheers.