Setting up Dropbox on Pinephone
DropBox is not natively available for aarch64/arm64, which presents a pain point for Pinephone users. Bananas, right? As a workaround, these instructions walk through setting up Rclone with Rclonesync to create a bidirectional sync with Dropbox on demand. Assumes a Pinephone Beta 2 running Manjaro.
⚠️OUT OF DATE⚠️
rclone now directly supports bidirectional syncing. Instead of setting up Rclonesync, you can create a script like mine:
#### bisync.sh start #!/bin/sh rclone bisync $1 --filters-file /home/user/dropbox-filter.txt dropbox-pine:/ ~/dropbox/ #### bisync.sh end
Assumptions
- You’re running a Pinephone Beta 2 with Manjaro
- You have a Dropbox account
- You are reasonably comfortable with a Bash terminal
- There is a dog snoring in your vicinity 🐕
Initial setup:
These steps will get you up and running with Rclone and Dropbox.
- Open a browser and log into Dropbox. This will make a later step easier.
- Open the phone terminal
- Run:
curl https://rclone.org/install.sh | sudo bash
- Then:
rclone config
- Type
n
for New remote - Enter a name. I used “dropbox-pine”
- Select Dropbox from the list. Right now, that was 11.
- Leave token and secret blank, press enter on each
n
to No Advanced OptionsY
to use autoconfig. A browser should open.- Log into Dropbox if you haven’t already
- Hopefully, you’ll now get a successful authorization prompt.
- Back in the terminal, you should see a success. Enter
y
to accept. q
to quit
Test (Optional)
Perform a dry run test to see if Rclone is talking to Dropbox.
- On a machine with Dropbox, create a path intended to sync with the Pinephone. I want to make it pretty explicit, so I made
~/Dropbox/pine
- On the phone:
mkdir ~/pine
- On the desktop:
echo hihi > ~/Dropbox/pine/test.txt
- On the phone:
rclone sync dropbox-pine:pine/ ~/pine/ --dry-run
- 5b transferred, 1/1, 100%. Success!
- Note: This was just a test, no files were transferred.
- You can sync with this alone, but it’s not fully bidirectional. To do that, I’ll set up rclonesync (https://github.com/cjnaz/rclonesync-V2)
Set up RcloneSync
⚠️OUT OF DATE⚠️: See above
Set up Rclonesync for bidirectional syncing between the Pinephone and desktops.
git clone https://github.com/cjnaz/rclonesync-V2.git
sudo cp rclonesync-V2/rclonesync /usr/local/bin
mkdir ~/.rclonesyncwd
- Perform the first sync:
rclonesync --first-sync dropbox-pine:pine/ ~/pine/
- Check pine/ for test.txt - is it there? Yes? Hooray! Bidirectional sync with dropbox!
Repeat results with an alias
If you only want to sync one path from Dropbox, we can take the easy way out here. I’ll just make an alias for convenience to run the necessary command:
- Add the alias:
echo alias dsync=\"rclonesync dropbox-pine:pine/ ~/pine/\" >> ~/.bashrc
- If this is new to you, read it as “add ‘alias dsync=…’ to the end of .bashrc”
- Bash will then read this as, “whenever I see ‘dsync’ I should run ‘rclonesync …'”
- You will need to re-launch Terminal or run
source ~/.bashrc
to reload the changes
- Test it by adding a file to /pine/, opening a new terminal, then running:
dsync
- Is that same file now on the desktop? Aces.
How do I sync multiple specific paths (like Selective Sync)?
We can use the filters-file option to control what is, and is not, synced under a new path. This is closer to Dropbox’s Selective Sync.
We’ll essentially keep the alias above, but change the syntax to include --filters-file
.
First, create a file called dropbox-filter.txt
in your home, with contents similar to:
# Include everything in /stories/ and any subdirectories
+ /stories/**
# Same for drafts
+ /drafts/**
# exclude everything else
- *
Make a new parent directory: mkdir ~/dropbox
Use nano .bashrc
to update the alias at the end to be:
alias dsync="rclonesync -f ~/dropbox-filter.txt dropbox-pine:/ ~/dropbox/"
Reload bash, then try dsync -dv
to run a dry run and make sure the correct paths are included.
As before, run dsync --first-sync
, then in the future, dsync
to synchronize changes.
Important: rclonesync has a safety feature that will abort the sync when it detects 100% of files have changed. Unfortunately, this is likely exactly what will happen if you are just testing this out with 1-2 files. You will need to run
dsync --force
in this case.
Tip: You can always run
dsync -v
or evendsync -vv
for more run-time details, and add these to the alias if preferred, e.g.alias dsync="rclonesync -vv -f ~/dropbox-filter.txt dropbox-pine:/ ~/dropbox/"
More information on the filter file: https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file
Where to go from here
It’s a little clunky in that we still need to run dsync
to keep our directory up to date at both ends. There are some scripts to tie into the Linux iNotify system that I’ll look into in the future. I hope you’ll understand if I take the simple win for now!
– POTTER