How to set cache-dir using rc options/set

I want to convert below rclone mount command to rclone rc options/set

rclone mount \
	--config=/home/ubuntu/.config/rclone/rclone.conf \
	--allow-other \
	--default-permissions \
	--no-modtime \
	--drive-use-trash \
	--uid=1001 \
	--gid=1002 \
	--cache-dir=/media/local/hdd/.rclone_cache \
	--dir-cache-time=1000h \
	--vfs-cache-max-age=10000h \
	--vfs-cache-max-size=50000G \
	--vfs-read-ahead=128M \
	--vfs-cache-mode=full

so far I have narrow it down to

rclone rc options/set \
	--rc-user 'username' --rc=pass 'password' \
	--json '{"main": {"Timeout": 3600000000000}, "mount": {"AllowOther": true, "DefaultPermissions": true}, "vfs": {"NoModTime": true, "UID": 1001 , "GID": 1002, "DirCacheTime": 3600000, "CacheMaxAge": 36000000, "CacheMaxSize": 
53687091200000,"ReadAhead": 134217728, "CacheMode": 4}, "log": {"File": "/var/log/rclone/rclone-mount.log"}}'

I ran rclone rc options/get and have following questions.

  • how to specify --drive-use-trash and --cache-dir=/media/local/hdd/.rclone_cache can not find appropriate options in json.
  • how to convert value of --dir-cache-time=1000h --vfs-cache-max-age=10000h to proper value, does Json expect values of DirCacheTime and CacheMaxAge under VFS in seconds?
  • how to convert value of --vfs-cache-max-size=50000G and --vfs-read-ahead=128M to proper value, does Json expects values of CacheMaxSize and ReadAhead in bytes?
  • --vfs-cache-mode=full ( "CacheMode": 4, is this correct? )

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

rclone v1.61.1

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

I am writing answers to all my questions.

  • how to specify --drive-use-trash and --cache-dir=/media/local/hdd/.rclone_cache can not find appropriate options in json.

--drive-use-trash is default, no need to specify.
since --cache-dir is global flags it can be specify in rcd command as follows

/usr/bin/rclone rcd \
	--config /home/ubuntu/.config/rclone/rclone.conf \
	--cache-dir /media/local/hdd/.rclone_cache \
	--log-file /tmp/rclone_mount.log \
	--rc-no-auth \
	--rc-addr :5572 \
	--rc-web-gui
  • how to convert value of --dir-cache-time=1000h --vfs-cache-max-age=10000h to proper value, does Json expect values of DirCacheTime and CacheMaxAge under VFS in seconds?
  • how to convert value of --vfs-cache-max-size=50000G and --vfs-read-ahead=128M to proper value, does Json expects values of CacheMaxSize and ReadAhead in bytes?
  • --vfs-cache-mode=full ( "CacheMode": 4, is this correct? )

as per Remote Control / API time is in nanoseconds, size can be specified using human readable formate.
--vfs-cache-mode=full is "CacheMode": 3
so full command as follows

rclone rc options/set \
    --rc-no-auth \
	--json '{"main": {"Timeout": 3600000000000}, "mount": {"AllowOther": true, "DefaultPermissions": true}, "vfs": {"NoModTime": true, "UID": 1001 , "GID": 1002, "DirCacheTime": 3600000000000000, "CacheMaxAge": 36000000000000000, "CacheMaxSize": "50T","ReadAhead": "128M", "CacheMode": 3}}'

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