Command-line syntax when not using config file?

I’d like to learn the command line systax for rclone when not using an rclone config but I cannot find any good samples that work.

One example I found is: rclone lsd --http-url https://pub.rclone.org :http:
What is confusing is the --http-url in combination with :http: I mean, --http-url means that the URL is an http URL, no? So why the :http:? And how would the syntax be in the case of a copy or sync command?

I know this can be done using environment variables as well, but that’s not what I am looking for. Any help?

My understanding is that the :http: part specifies what type of remote you are using. In the example you are using a simple http remote that doesn’t need any confguration in this case, but you still need to tell rclone that the remote type is http so it knows how to work with it.

From the docs:

:backend:path/to/dir

This is an advanced form for creating remotes on the fly. backend should be the name or prefix of a backend (the type in the config file) and all the configuration for the backend should be provided on the command line (or in environment variables).

Eg

rclone lsd --http-url https://pub.rclone.org :http:

Which lists all the directories in pub.rclone.org.

I think this could be clarified better in the docs, maybe giving instructions on how to view the currently supported remotes or putting a list right there. cc @ncw. I’m not sure if it’s possible to use all remote types without a config type though.

1 Like

Yeah, so what i have found out so far is this (Mega example):

You need to obscure your password first: rclone obscure <mypassword>
You will get a string back. This string has to be used as your password in the rclone copy command.
Then you can use the following syntax:rclone copy -vv --mega-user <my_mega_account> --mega-pass <my_encrypted_mega_password> --mega-debug :mega:<remote source dir> <local dest dir>
Be aware: No space between the:mega: and the <remote source dir>.

This worked for me, but is inconsistent with the rclone lsd example in the documentation.
The documentation states: rclone lsd --http-url https://pub.rclone.org :http:
What is confusing is that in the example the :backend: is not part of the source URL where in my Mega example it is.

So there is room for improvement here since --http-url already states that the following URL is an http URL.

The :http: part seems to be both the remote type and it also specifies the root of the remote.

If in the origina example you wanted to list the contents of integration-tests/ at the root of https://pub.rclone.org, you’d do this:

rclone lsd --http-url https://pub.rclone.org :http:/integration-tests

I tested it, and it works.

1 Like

Oh, ok. So the base URL and the directory into the http “filesystem” need to be separated out and the directory needs to be prepended with the :backend:
That makes sense.

Thanks!!

Would the example be clearer if it was rclone lsd --http-url https://pub.rclone.org :http:path/to/directory?

rclone lsd --http-url https://pub.rclone.org :http:path/to/directory as one example and an rclone copy example with source and destination paths using this syntax would be good as well.

OK, I’ve done that now - thanks for the suggestion. (This will be visibile on tip.rclone.org tomorrow and on rclone.org at the next release).

1 Like