What is the problem you are having with rclone?
I'm having some trouble using strings with rclone rc options/set
. Most likely just a misunderstanding on my part!
Run the command 'rclone version' and share the full output of the command.
rclone v1.60.1
- os/version: debian 11.5 (64 bit)
- os/kernel: 5.10.0-19-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.3
- go/linking: static
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
Google Drive
I have a systemd service like so:
ExecStart=/usr/local/bin/rclone rcd \
--rc-addr=0.0.0.0:5572 \
--rc-htpasswd=/root/.rclone_web.htpasswd \
--rc-enable-metrics \
--config=/root/.config/rclone/rclone.conf \
--cache-dir=/mnt/scratch/rclone \
--log-level INFO \
--log-file=/var/log/rclone/rcd.log \
# Set global opts
ExecStartPost=/usr/local/bin/rclone rc options/set \
--user 'rclone' --pass 'redacted' \
--json '{"main": {"UserAgent": "rclone-gdrive", "Timeout": 3600000000000}, "mount": {"AllowOther": true}, "vfs": {"Umask": 2, "UID": 1000, "GID": 1000, "PollInterval": 15000000000, "DirCacheTime": 3600000000000000, "CacheMaxAge": 129600000000000, "CacheMaxSize": 322122547200, "CacheMode": 3}}'
# Mount remote
ExecStartPost=/usr/local/bin/rclone rc mount/mount \
--user 'rclone' --pass 'redacted' \
fs=gdrive-media-crypt:media mountPoint=/mnt/gmedia-cloud
With the rclone rc options/set
command, I'm using integers. Having read the data types section of the rc docs, I decided to swap these for shorthand strings, for the sake of simplicity.
To make sure I got it right, I ran this before amending the systemd service (I'm aware 3600000000000
!= 5s
, just testing here):
rclone rc --user=rclone --pass='redacted' options/set --json '{ "main": {"Timeout": "5s"}}'
However, I received the following error:
2022/11/30 14:48:48 Failed to rc: failed to read rc response: 500 Internal Server Error: {
"error": "failed to write options from block \"main\": Reshape failed to Unmarshal: json: cannot unmarshal string into Go struct field ConfigInfo.Timeout of type time.Duration",
"input": {
"main": {
"Timeout": "5s"
}
},
"path": "options/set",
"status": 500
}
Am I misunderstanding something here? That seems most likely.... Any tips would be appreciated!
Thanks!