I am trying to copy a local dir with multiple files to a mount but it only ever seems to copy the contents of the dir not the dir and its contents. I can create the dir in the remote and then copy but that is awkward as i work from a phone a lot so copy and paste is not ideal.
Surely there has to be a better way than what i am doing.
I dont see any other options on the rclone copy docs. rclone copy
Run the command 'rclone version' and share the full output of the command.
rclone v1.59.1
os/version: ubuntu 18.04 (64 bit)
os/kernel: 4.15.0-192-generic (x86_64)
os/type: linux
os/arch: amd64
go/version: go1.18.5
go/linking: static
go/tags: none
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)
this command does seem to work but its a nightmare as i have to manually enter the path on the remote since tab wont auto complete it. Please note i do a lot of work from a phone so its not that easy for me to copy and paste stuff.
That's why we ask for a log file as trying to figure out what you mean isn't always clear, but a log file helps to clear that up as it shows exactly what command you run and the actual output.
It's about context so without a logfile to see what you are talking about, it's really tough.
Here is a copy command copying the directories and all the files in the directories.
felix@gemini:~$ rclone copy test1 test2 -vv
2022/10/07 07:57:44 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/10/07 07:57:44 DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "copy" "test1" "test2" "-vv"]
2022/10/07 07:57:44 DEBUG : Creating backend with remote "test1"
2022/10/07 07:57:44 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/10/07 07:57:44 DEBUG : fs cache: renaming cache item "test1" to be canonical "/home/felix/test1"
2022/10/07 07:57:44 DEBUG : Creating backend with remote "test2"
2022/10/07 07:57:44 DEBUG : fs cache: renaming cache item "test2" to be canonical "/home/felix/test2"
2022/10/07 07:57:44 DEBUG : Local file system at /home/felix/test2: Waiting for checks to finish
2022/10/07 07:57:44 DEBUG : one: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/10/07 07:57:44 INFO : one: Copied (new)
2022/10/07 07:57:44 DEBUG : Local file system at /home/felix/test2: Waiting for transfers to finish
2022/10/07 07:57:44 DEBUG : two: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/10/07 07:57:44 INFO : two: Copied (new)
2022/10/07 07:57:44 DEBUG : adirectory/afileinadirectory: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/10/07 07:57:44 INFO : adirectory/afileinadirectory: Copied (new)
2022/10/07 07:57:44 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Transferred: 3 / 3, 100%
Elapsed time: 0.0s
2022/10/07 07:57:44 DEBUG : 5 go routines active
felix@gemini:~$ ls -al test1
total 0
drwxrwxr-x 1 felix felix 32 Oct 7 07:57 .
drwxr-x--- 1 felix felix 258 Oct 7 07:57 ..
drwxrwxr-x 1 felix felix 34 Oct 7 07:57 adirectory
-rw-rw-r-- 1 felix felix 0 Oct 7 07:56 one
-rw-rw-r-- 1 felix felix 0 Oct 7 07:57 two
felix@gemini:~$ ls -al test2
total 0
drwxrwxr-x 1 felix felix 32 Oct 7 07:57 .
drwxr-x--- 1 felix felix 258 Oct 7 07:57 ..
drwxrwxr-x 1 felix felix 34 Oct 7 07:57 adirectory
-rw-rw-r-- 1 felix felix 0 Oct 7 07:56 one
-rw-rw-r-- 1 felix felix 0 Oct 7 07:57 two
If you want to share a log and show what you are talking about, happy to help.
The way rclone works is that it does not work like a regular copy command as if you give it a path, it is relative and copies down.
If you want the same directory name on the destination and it not to be relative.
felix@gemini:~/test2$ ls
test
felix@gemini:~/test2$ rm -rf test
felix@gemini:~/test2$ ls
felix@gemini:~/test2$ cd
felix@gemini:~$ ls -alr test1
total 0
-rw-rw-r-- 1 felix felix 0 Oct 7 07:57 two
-rw-rw-r-- 1 felix felix 0 Oct 7 07:56 one
drwxrwxr-x 1 felix felix 34 Oct 7 07:57 adirectory
drwxr-x--- 1 felix felix 258 Oct 7 07:57 ..
drwxrwxr-x 1 felix felix 32 Oct 7 07:57 .
felix@gemini:~$ rclone copy test1 test2/test1 -vv
2022/10/07 08:43:27 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/10/07 08:43:27 DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "copy" "test1" "test2/test1" "-vv"]
2022/10/07 08:43:27 DEBUG : Creating backend with remote "test1"
2022/10/07 08:43:27 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/10/07 08:43:27 DEBUG : fs cache: renaming cache item "test1" to be canonical "/home/felix/test1"
2022/10/07 08:43:27 DEBUG : Creating backend with remote "test2/test1"
2022/10/07 08:43:27 DEBUG : fs cache: renaming cache item "test2/test1" to be canonical "/home/felix/test2/test1"
2022/10/07 08:43:27 DEBUG : Local file system at /home/felix/test2/test1: Waiting for checks to finish
2022/10/07 08:43:27 DEBUG : Local file system at /home/felix/test2/test1: Waiting for transfers to finish
2022/10/07 08:43:27 DEBUG : one: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/10/07 08:43:27 DEBUG : two: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/10/07 08:43:27 INFO : two: Copied (new)
2022/10/07 08:43:27 INFO : one: Copied (new)
2022/10/07 08:43:27 DEBUG : adirectory/afileinadirectory: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2022/10/07 08:43:27 INFO : adirectory/afileinadirectory: Copied (new)
2022/10/07 08:43:27 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Transferred: 3 / 3, 100%
Elapsed time: 0.0s
2022/10/07 08:43:27 DEBUG : 3 go routines active
even better
I; m trying currently to promte the use of rclone on our supercomputer (Snellius, NL). I have been using rsync quite a lot, hence the misunderstanding.
THX for pointing it out, I removed my answer to avoid confusing the users