Is it possible use rclone to copy file from one storage account to another

What is the problem you are having with rclone?

I want to copy a blob file from one storage account to another storage account.

What is your rclone version (output from rclone version)

rclone v1.49.5

  • os/arch: darwin/amd64
  • go version: go1.13.1

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Mac

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

Azure blob

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

rclone copy :azureblob:src_folder/filename :azureblob:dest_folder --progress --azureblob-account=src_storage_account --azureblob-endpoint=blob.core.windows.net --azureblob-key=xxx --azureblob-account=dest_storage_account --azureblob-endpoint=blob.core.windows.net --azureblob-key=zzzz -v

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

2019-10-14 14:30:34 ERROR : : error reading source directory: directory not found
2019-10-14 14:30:34 INFO : Azure container dest_folder: Waiting for checks to finish
2019-10-14 14:30:34 INFO : Azure container dest_folder: Waiting for transfers to finish
2019-10-14 14:30:34 ERROR : Attempt 1/3 failed with 2 errors and: directory not found
2019-10-14 14:30:35 ERROR : : error reading source directory: directory not found
2019-10-14 14:30:35 INFO : Azure container dest_folder: Waiting for checks to finish
2019-10-14 14:30:35 INFO : Azure container dest_folder: Waiting for transfers to finish
2019-10-14 14:30:35 ERROR : Attempt 2/3 failed with 2 errors and: directory not found
2019-10-14 14:30:35 ERROR : : error reading source directory: directory not found
2019-10-14 14:30:35 INFO : Azure container dest_folder: Waiting for checks to finish
2019-10-14 14:30:35 INFO : Azure container dest_folder: Waiting for transfers to finish
2019-10-14 14:30:35 ERROR : Attempt 3/3 failed with 2 errors and: directory not found
Transferred: 0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors: 2 (retrying may help)
Checks: 0 / 0, -
Transferred: 0 / 0, -
Elapsed time: 0s
2019/10/14 14:30:35 Failed to copy with 2 errors: last error was: directory not found

I see what is wrong with this...

The command line parameters for rclone are a bit primitive in some ways, so rclone will be using the first or last -azureblob-account. You can't write them like that alas. I made an upstream issue on the command line parser I use to error out in this situation.

So if you want to go for no config file then you can configure the remotes with environment variables instead

export RCLONE_CONFIG_SRC_TYPE=azureblob
export RCLONE_CONFIG_SRC_ACCOUNT=src_storage_account
export RCLONE_CONFIG_SRC_ENDPOINT=http://blob.core.windows.net
export RCLONE_CONFIG_SRC_KEY=xxx

export RCLONE_CONFIG_DST_TYPE=azureblob
export RCLONE_CONFIG_DST_ACCOUNT=dest_storage_account
export RCLONE_CONFIG_DST_ENDPOINT=http://blob.core.windows.net
export RCLONE_CONFIG_DST_KEY=zzzz

rclone copy src:src_folder/filename dst:dest_folder --progress -v
```

Thanks for your response.

The reason why I use command line parameters for rclone is that I want to use golang to control rclone to handle multi-cloud file operation.

I have see the following request, and also try to import rclone as library.


But staill fail. Can you teach me how to do that ?

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