Rclone cat for HTTP API

What is the problem you are having with rclone?

I'd want to to use the HTTP API to use rclone cat but haven't found the command or an alternative on here: Remote Control / API

Run the command 'rclone version' and share the full output of the command.

rclone v1.62.2

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.19.0-43-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.20.2
  • go/linking: static
  • go/tags: none

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

just testing locally

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

I'm looking for the command. :slight_smile:

And what would be stdout for remotely controlled rclone? How you see it working.

Actually what is the problem you are trying to solve? Maybe there is other way to approach it.

I went through this.

The answer is to turn on --rc-serve and then you can access it via HTTP. Note that you can use the [<remote>]/path/to/files URL scheme

and how is helps to solve original rclone cat question?

yes, I'm doing that already.
As kapitainsky says, I'd need to read a file (cat) with the HTTP API.
To make it more clear, I can do something like this at the moment already:

curl -X POST http://localhost:5572/operations/list -H "Content-Type: application/json" -d '{"fs": "local:", "remote": "/exampleDir"}'

What I'd want to do (probably not implemented, but maybe there is a way around this):

curl -X POST http://localhost:5572/operations/cat -H "Content-Type: application/json" -d '{"fs": "local:", "remote": "/exampleDir/exampleFile.txt"}'

and this is exactly my question - what would you expect this operations/cat does?

Send results where? which stdout? As this is what cat does

I am not an expert in curl so forgive me but you would do:

curl http://localhost:5572/[local:]/exampleDir/exampleFile.txt

No need to call rclone here. Just download the file it is serving. Test this out in your webrowser. If you run with --rc-serve, you should be able to just browse http://localhost:5572/

See my reply. It will send it wherever curl send it.

ok. I see your point.

The same can be achieved with wget

wget -O - -o /dev/null http://localhost:5572/[local:]/exampleDir/exampleFile.txt

I only tried the curl (had to url encode the '[' and ']') but that works.
wget should work as well.

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