What is the problem you are having with rclone?
I'm using HTTP POST to control my remote rclone rcd server, and I expect it to work the same as running rclone copy source/to/directory dest:/
, which creates dest:/directory
, and copies the file inside. But it actually got dest:/{other files under directory}
without creating a top-level directory.
Run the command 'rclone version' and share the full output of the command.
rclone v1.67.0
- os/version: Microsoft Windows 11 Pro 23H2 (64 bit)
- os/kernel: 10.0.22631.4037 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.22.4
- go/linking: static
- go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
Microsoft OneDrive
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
I run rclone rcd:
rclone rcd --rc-user=admin --rc-pass=secret --rc-addr=localhost:5572
And my http post request: ( using java):
createEmptySrcDirs
both true and false are tried.
public static boolean copy(String src, String dst) {
String host = ConfigUtil.CONFIG.getRcloneHost();
String username = ConfigUtil.CONFIG.getRcloneuserName();
String password = ConfigUtil.CONFIG.getRclonePassword();
JsonObject obj = new JsonObject();
obj.addProperty("srcFs", src);
obj.addProperty("dstFs", dst);
obj.addProperty("createEmptySrcDirs", true);
try {
return HttpRequest.post(host + "/sync/copy")
.basicAuth(username, password)
.header("Content-Type", "application/json")
.body(GsonStatic.toJson(obj))
.thenFunction(res -> {
Assert.isTrue(res.isOk(), res.body());
log.info("rclone copied src: {}, dst: {}", src, dst);
return true;
});
} catch (Exception e) {
log.error("rclone copy error: {}", e.getMessage());
return false;
}
}
Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.
Paste config here
A log from the command that you were trying to run with the -vv
flag
Paste log here