How to submit sync/copy job via http post in rclone RC mode?

Hello experts,

I m new to Rclone, trying to use rclone with apache nifi for sftp/cloud(s3/blob/gcp) to cloud files transfer.

Tried rclone RC mode with command line commands like below and it works fine -

rclone rc sync/copy srcFs=LocalSFTP:newdirectory dstFs=LocalSFTP:target10jan123 recursive=true --rc-addr _async=true
and able to see status with below end point with postman.

Now i want to submit this sync/copy operation through http post (like status check above) instead of command line.
I could not find real example for this, can some one help me with http post example for this?

also wondering if i can point different .conf file than default one for this copy operation
(for non rc mode i can use --config option, similar option i m looking for RC with http api mode)

Hi Mahendra,

Here is a recent sync/sync example:
you can probably find more by searching the forum.

Here is the documentaion on http post:

1 Like

In javascript, something like:
let rclone_options = { srcFs: "source_path", dstFs: "destination_path"};
let url = your_rclone_url + "/sync/copy";, rclone_options)


@Ole - Thank you so much, forum link helped me out.
Able to submit the job over http post.
But still could not find way to point non default .config file while using RC mode (http mainly)

1 Like

Great, happy to hear!

I think it can be done with the _config option described here:

The example linked above used it to set the --dry-run parameter.

Not sure what the exact key is, but I guess you get find it with options/get described here:

@notclickable Can you confirm/supplement/correct me?

@Ole that's correct, check rclone rc options/get for the correct form for the config, then pass it into your POST as part of your json body , e.g "_config":{"CheckSum": true. "DryRun": true}. Generally they are CamelCase forms of the associated command line flags.

1 Like

Combined with the axios post above that would be:
let rclone_options = { srcFs: "source_path", dstFs: "destination_path", "_config":{"CheckSum": true. "DryRun": true}};

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