Rclone Setup for Dropbox Print

  • 0

Beside using Dropbox native app, you may also use rclone to mount your Dropbox drive. There are a number of reasons why you may want to use rclone instead of the native app:

  • You want to use a different Dropbox account or multiple accounts
  • You want to use Dropbox account as a drive
  • You don't want to pick and choose what to sync and want all files stream as you use it
  • You want to know how much space you use, not total space used by all users
  • Control API limit, caching and other parameters
  • Encrypt your data

 

Rclone Install

You may download rclone from rclone.org. An older version is preferred as it allows creation of classic token which has no expiration date.

https://rclone.org/downloads/

Linux:

Rclone is self-contained static binary so no dependency libraries are needed, you may either just extract the binary and run, or install using package.

If you are new to Linux, it's easier if you run "sudo su -" to become root user first before running any commands.

Redhat:

yum -y install fuse

yum -y install ./rclone-v1.52.3-linux-amd64.rpm

Debian/Ubuntu:

apt install ./rclone-v1.52.3-linux-amd64.deb

Port forwarding for non-GUI install

If you are not using desktop GUI for your linux or accessing your computer remotely, you would need to setup ssh port forwarding for Dropbox authorization. To ssh to your linux server you may use Putty. You may configure port forwarding either as a new saved session or dynamically in Putty. Open Putty configuration, go to Connection > SSH > Tunnels. In Source port, put "53682", in Destination put "127.0.0.1:53682", click Add.

Get Dropbox Authorization token

run below command to get your dropbox token:

rclone authorize dropbox

A browser window would popup, if it doesn't, just paste the URL appeared in the terminal window. For non-GUI install, you would need to copy the URL, then open your local browser and paste the url in address box. Click "Allow" on the prompt and you would get a token like below:

{"access_token":"9iNjEFPyQeAAAAAAAAAAAThzZDRUdGjvYtsp8PxVyyOdT6u9StQVGaeJ5G_1Hels","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}

save this token for later use.

Rclone config

run "rclone config"

Choose New and then Dropbox, name it say dropbox, accept all defaults (will config later with config file if needed), At remote config section, choose no for auto config (unless you have GUI desktop). Paste the access token when prompted for the token result.

After config and quit, try to mount with "rclone mount dropbox: /mnt &", assuming dropbox is the name. Do "df" and you should see the drive, if not need to do it again. To stop the mount, kill the job using "kill %1", if you have multiple background jobs, run "jobs" first.

If successful, create a new mount point with "mkdir /mnt/dropbox"

Add Encryption (Optional)

To protect your privacy we recommend you to encrypt all your data. Run rclone config again, add an encrypt drive pointing to dropbox drive, name it say dropboxe. Encryption can be at the drive level or folder level.

Check config and strart rclone

Edit the /root/.config/rclone/rclone.conf and you should see something like below.

[dropbox]
type = dropbox
token = {"access_token":"<snip>","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}

[dropboxe]
type = crypt
remote = dropbox:
filename_encryption = standard
directory_name_encryption = true
password = <snip>

Setup system service:

vi /etc/systemd/system/rclone.service

# /etc/systemd/system/rclone.service
[Unit]
Description=Rclone VFS Mount
After=network-online.target

[Service]
#User=plex
#Group=plex
Type=notify
#ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/rclone mount \
--allow-other \
--config=/root/.config/rclone/rclone.conf \
--vfs-cache-mode writes \
--transfers 100 \
--use-mmap \
--syslog \
--no-traverse \
dropbox: /mnt/dropbox
ExecStop=/bin/fusermount -uz /mnt/dropbox
TimeoutStartSec=3600
Restart=always
RestartSec=3600

[Install]
WantedBy=default.target

If you are using encryption, use "dropboxe:" instead of "dropbox:".

Start the mount:

systemctl enable rclone

systemctl start rclone

If you encounter errors, please check /var/log/messages or /var/log/sylog (Ubuntu) and try again.

By default rclone uses /tmp/rclone for cache, if you don't have enough space in /tmp, you can setup symbolic link or add path option in config to another directory.

 

Windows:

For Windows you also need to download and install winfsp and nssm:

http://www.secfs.net/winfsp/rel/

https://nssm.cc/download

Install Winfsp using Installer, accept all defaults, copy rclone and nssm to  c:\windows\system32\

Rclone config

If you already configured rclone using above steps for Linux, you may just copy the config file over. If not run the below command:

rclone config

Choose New and then Dropbox, name it say dropbox. Accept all defaults (you may update config file later). During auto config a browser window will popup, click on "allow" to authorize rclone for Dropbox.

Try mount on command line "rclone mount dropbox: z:", if you see the drive in Windows Explorer you may press ctrl-c to stop the mount.

To enable encryption, run rclone config again and create a crypt drive pointing to dropbox drive, name it say dropboxe.

install service by running "nssm install rclone"

For path put c:\windows\systeme32\rclone.exe, for Arguments put below:

mount dropbox: z: --transfers=100 --allow-other --vfs-cache-mode writes --use-mmap --no-traverse --config c:\users\User\.config\rclone\rclone.conf

Replace "User" if it's not your login id. You may use any drive letter. If you use encryption, replace "dropbox:" with "dropboxe:".

Start rclone and you should see drive z:

nssm start rclone

If not working, add --log option and log to a file and check for errors. The rclone config file is at %userprofile%\.config\rclone\rclone.conf.

If you want to create more dropbox drives, just run rclone config again and use another name for the new Dropbox account.

 


Was this answer helpful?

« Back