Rclone on Cygwin not recognizing destination on a mapped drive

What is the problem you are having with rclone?

Cygwin sees drives as:

/cygdrive/<drive letter>

C-drive is:

/cygdrive/c

image

A mapped (M or N) drive are:

/cygdrive/m
/cygdrive/n

image

However, when specifying a path on a mapped drive, and running the command from the C drive, rclone is creating the path off of the C root:

image

When running the command from the N drive, rclone is creating the entire path off the N root:

image

I'd like to have the destination path to be absolute and copy the folders in the same location regardless of where I run rclone from.

Run the command 'rclone version' and share the full output of the command.

rclone v1.57.0

  • os/version: Microsoft Windows 10 Pro 2009 (64 bit)
  • os/kernel: 10.0.19043.1469 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.17.2
  • go/linking: dynamic
  • go/tags: cmount

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

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone copy --verbose --create-empty-src-dirs personalgoogledrive:Personal/Test /cygdrive/n/Backups/GoogleDrive/Test```


#### The rclone config contents with secrets removed.  
<!--  You should use 3 backticks to begin and end your paste to make it readable.   -->

[personalgoogledrive]
type = drive
client_id =
client_secret =
token = {"access_token":"","token_type":"Bearer","refresh_token":"","expiry":"2022-01-27T10:56:05.3148427-08:00"}




#### A log from the command with the `-vv` flag  
<!-- You should use 3 backticks to begin and end your paste to make it readable.  Or use a service such as https://pastebin.com or https://gist.github.com/   -->

$ rclone copy -vv --verbose --create-empty-src-dirs personalgoogledrive:Personal/Test /cygdrive/n/Backups/GoogleDrive/Test 2022/01/27 13:23:57 DEBUG : rclone: Version "v1.57.0" starting with parameters ["C:\cygwin\bin\rclone.exe" "copy" "-vv"
"--verbose" "--create-empty-src-dirs" "personalgoogledrive:Personal/Test" "/cygdrive/n/Backups/GoogleDrive/Test"]
2022/01/27 13:23:57 DEBUG : Creating backend with remote "personalgoogledrive:Personal/Test"
2022/01/27 13:23:57 DEBUG : Using config file from "C:\Users\amagha\AppData\Roaming\rclone\rclone.conf"
2022/01/27 13:23:57 DEBUG : Google drive root 'Personal/Test': 'root_folder_id = 0APhkgeeC--oXUk9PVA' - save this in the co
nfig to speed up startup
2022/01/27 13:23:57 DEBUG : Creating backend with remote "/cygdrive/n/Backups/GoogleDrive/Test"
2022/01/27 13:23:57 DEBUG : fs cache: renaming cache item "/cygdrive/n/Backups/GoogleDrive/Test" to be canonical "//?/UNC/m
ybookworld3/Public/cygdrive/n/Backups/GoogleDrive/Test"
2022/01/27 13:23:58 DEBUG : Local file system at //?/UNC/mybookworld3/Public/cygdrive/n/Backups/GoogleDrive/Test: Waiting f
or checks to finish
2022/01/27 13:23:58 DEBUG : Local file system at //?/UNC/mybookworld3/Public/cygdrive/n/Backups/GoogleDrive/Test: Waiting f
or transfers to finish
2022/01/27 13:23:59 DEBUG : test1.txt: md5 = c96008bfbee7d403032ab5e70b4af00d OK
2022/01/27 13:23:59 INFO : test1.txt: Copied (new)
2022/01/27 13:23:59 DEBUG : test2.txt: md5 = bbd19a0bcd2b70c07942bdc293cd3b90 OK
2022/01/27 13:23:59 INFO : test2.txt: Copied (new)
2022/01/27 13:23:59 DEBUG : f3/f3.test.txt: md5 = c96008bfbee7d403032ab5e70b4af00d OK
2022/01/27 13:23:59 INFO : f3/f3.test.txt: Copied (new)
2022/01/27 13:23:59 DEBUG : f2 - space: Making directory
2022/01/27 13:23:59 DEBUG : f4 - space: Making directory
2022/01/27 13:23:59 DEBUG : f1: Making directory
2022/01/27 13:23:59 DEBUG : Local file system at //?/UNC/mybookworld3/Public/cygdrive/n/Backups/GoogleDrive/Test: copied 3
directories
2022/01/27 13:23:59 INFO :
Transferred: 41 B / 41 B, 100%, 40 B/s, ETA 0s
Transferred: 3 / 3, 100%
Elapsed time: 2.2s

2022/01/27 13:23:59 DEBUG : 15 go routines active

hello and welcome to the forum,

that debug log, cannot tell what the current working directory is?
/cygdrive/c or /cygdrive/n

and what is that absoulte same location path?

what is wrong with this?

renaming cache item "/cygdrive/n/Backups/GoogleDrive/Test" to be canonical "//?/UNC/mybookworld3/Public/cygdrive/n/Backups/GoogleDrive/Test"`

also, please, enclose text with three backticks so it is formated like this.

[personalgoogledrive]
type = drive
client_id =
client_secret =
token = {"access_token":"","token_type":"Bearer","refresh_token":"","expiry":"2022-01-27T10:56:05.3148427-08:00"}
1 Like

That was from /cygdrive/n

I think this might be the issue! For some reason Cygwin isn't recognizing the path when I specify /cygdrive/n/...

However, I just tried putting the Windows path the the location, and that worked!

//mybookworld3/Public/Backups/GoogleDrive/Personal

For someone that finds this, the following worked for me once a drive was mapped to the network drive:

rclone sync --verbose --create-empty-src-dirs personalgoogledrive:Personal //mybookworld3/Public/Backups/GoogleDrive/Personal

I'm getting the "mybookworld3" from what my N drive maps as:

image

If you are using the windows native version of rclone then it won't understand /cygdrive/n to mean N:. Even though you're starting from inside cygwin you would be using a native windows executable and so it expects native windows pathnames.

That's because cygwin hooks in at the library level and expects programs to link to that library. So if you run a program like cat /cygwin/n/hello.txt then the cat program tries to do an open("/cygwin/n/hello.txt",...) and the cygwin open() library will do the necessary translations between the Unix format of the call and the Windows call.

Windows native executables don't use the cygwin libraries so don't do that, so if you used the Windows notepad /cygwin/n/hello.txt command then it'd fail.

I don't think GoLang supports cygwin and so Go programs (such as rclone) won't understand cygwin paths.

1 Like

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