Creating unneeded folders for single file uploads

What is the problem you are having with rclone?

rclone creates a subdirectory for all files uploaded to remote. For instance, if I try to upload the file readme.txt, it creates a directory called readme.txt and places the file in the created directory. Thanks for the help!

user:$ rclone ls gdrive:
     2829 readme.txt/readme.txt

What is your rclone version (output from rclone version)

rclone v1.57.0

  • os/version: ubuntu 20.04 (64 bit)
  • os/kernel: 5.4.0-89-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.2
  • 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)

rclone copy readme.txt gdrive:readme.txt

The rclone config contents with secrets removed.

type = drive
scope = drive
service_account_file = /home/user/service_account.json
team_drive = XXXXX
root_folder_id =

type = crypt
remote = gdrive:protected
password = XXXXX
password2 = XXXXX

A log from the command with the -vv flag

2021/12/20 19:56:47 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "copy" "readme.txt" "gdrive:readme.txt" "-vv"]
2021/12/20 19:56:47 DEBUG : Creating backend with remote "readme.txt"
2021/12/20 19:56:47 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2021/12/20 19:56:47 DEBUG : fs cache: adding new entry for parent of "readme.txt", "/home/user/Dental Database/Data Sources"
2021/12/20 19:56:47 DEBUG : Creating backend with remote "gdrive:readme.txt"
2021/12/20 19:56:48 DEBUG : readme.txt: Need to transfer - File not found at Destination
2021/12/20 19:56:50 DEBUG : readme.txt: md5 = 0d3962f26fbdc596cf0c9c85c947de93 OK
2021/12/20 19:56:50 INFO  : readme.txt: Copied (new)
2021/12/20 19:56:50 INFO  :
Transferred:        2.763 KiB / 2.763 KiB, 100%, 2.760 KiB/s, ETA 0s
Transferred:            1 / 1, 100%
Elapsed time:         2.8s

2021/12/20 19:56:50 DEBUG : 8 go routines active

That's how it works. If you pass a name, it creates a folder. Just remove the name at the end.

Oh geez. I feel silly now. Thanks for the help!

No worries at all.

Check out:

rclone copy


rclone copyto

to get an idea.

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