Repository navigation
Description
What is the problem you are having with rclone?
An invocation which includes a trailing /. on the target path (as is often done by long-time Unix users) causes an entry to be created in dropbox named ".".
For example:
rclone copy somefile dropbox:somedir/.
A user might reasonably expect somedir/. to be interpreted the same as somedir, like it is for all other Unix-like tools. e.g. with cp or scp, adding /. to the end of the target dir will cause the copy to fail if the target dir doesn't exist, rather than copying the target file to a file named somedir.
Instead the target gets a directory named "." and somefile copied into it.
"." is not a legal name for a directory on any known non-cloud storage, as it's reserved for "current directory."
My proposal is that rclone silently lop off any trailing "/." from the name, as the intent of adding "/.", as its interpreted by every other tool, is exactly what rclone already does without the "/.". Because "." is (outside of cloud storage) not a legal directory name, it seems highly unlikely that anyone actually relies on the current behaviour.
What is your rclone version (output from rclone version)
rclone v1.53.1
- os/arch: linux/arm
- go version: go1.15
Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
Raspberry Pi OS 10
Which cloud storage system are you using? (e.g. Google Drive)
DropBox and Google Drive both exhibit this.
The DropBox web UI will not allow one to create a directory with this name, but GDrive's web UI does.
The command you were trying to run (e.g. rclone copy /tmp remote:tmp)
rclone copy somefile dropbox:somedir/.
A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)
$ rclone -vv copy conversion.txt gdrive:xfer/.
2020/12/16 11:39:17 DEBUG : rclone: Version "v1.53.1" starting with parameters ["rclone" "-vv" "copy" "conversion.txt" "gdrive:xfer/."]
2020/12/16 11:39:17 DEBUG : Creating backend with remote "conversion.txt"
2020/12/16 11:39:17 DEBUG : Using config file from "/home/pi/.config/rclone/rclone.conf"
2020/12/16 11:39:17 DEBUG : fs cache: adding new entry for parent of "conversion.txt", "/<SNIP>"
2020/12/16 11:39:17 DEBUG : Creating backend with remote "gdrive:xfer/."
2020/12/16 11:39:17 DEBUG : Google drive root 'xfer/.': root_folder_id = "<SNIP>" - save this in the config to speed up startup
2020/12/16 11:39:19 DEBUG : conversion.txt: Need to transfer - File not found at Destination
2020/12/16 11:39:21 DEBUG : conversion.txt: MD5 = 6e8f7d56b5c772c227ea5e0b5d997a05 OK
2020/12/16 11:39:21 INFO : conversion.txt: Copied (new)
2020/12/16 11:39:21 INFO :
Transferred: 1.137k / 1.137 kBytes, 100%, 428 Bytes/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 4.4s
2020/12/16 11:39:21 DEBUG : 4 go routines active
Activity
ncw commentedon Dec 18, 2020
I think the fix I've been working on in #4862 will fix this issue too - can you give it a try?
v1.54.0-beta.4970.7493dd856.fix-4862-fs-parse on branch fix-4862-fs-parse (uploaded in 15-30 mins)
sgbeal commentedon Dec 18, 2020
i am very much a git zero[1], so i'll need more information on that for how to check out that branch :/. Simply doing
checkout branchnameon a clone of this repo isn't doing it for me:Following the fix-4862-... link in your response leads to github's 404 page.
Over there i'm only seeing what appear to be zip files of builds for bsd/plan9/solaris platforms i don't have, and not any sources.
[1] = i'm a long-time developer on the Fossil SCM project and, quite thankfully, almost never have to work with git, so operations more involved than clone or checkout of an existing branch are usually beyond my git-fu.
animosity022 commentedon Dec 20, 2020
The build failed so he'll have to redo it.
It takes times to build so he posts the link and at times, it doesn't build so he's gotta redo it.
Nothing to do from your side until the build gets fixed.
ivandeex commentedon Mar 16, 2021
@sgbeal
That git branch has been merged in and released. Try to install the latest version 1.54.1 - https://rclone.org/install/
Does it help?
sgbeal commentedon Mar 16, 2021
1.54.1 still exhibits this behaviour. The "." directory in the attached screenshot now contains the file "foo.c".
It's not tragic, it's just counter to years of CLI muscle memory which believes that tagging
/.on the end of a directory target is "best practice" to avoid creating a file with the target directory's name by accident if the target name is mis-typed (in particular over SSH connections where tab completion isn't available).ivandeex commentedon Mar 16, 2021
I think this should help
rclone copy somefile dropbox:somedir/. --dropbox-encoding Nonesgbeal commentedon Mar 16, 2021
That's arguably an improvement over creation of a dir named ".". How can (or can at all?) that encoding option be set as the default in my rclone config?
sgbeal commentedon Mar 16, 2021
Nevermind:
does the trick. :)
ivandeex commentedon Mar 16, 2021
Right, this will do the trick, but I'd recommend
Actually, it's not a "normal" ASCII dot but a UTF-8 wide dot glyph that looks like a dot but is treated as a directory name by cloud.
rclone performs this and other translations provider-wise as many local filesystem conventions are different in the cloud world.
ivandeex commentedon Mar 16, 2021
Probably we will introduce an option to normalize paths before encoding.
references: #4897 (comment) and #4948 (comment)
ivandeex commentedon Mar 16, 2021
I hope this is resolved