I wanted to integrate Onedrive into my Linux desktop without having to manually sync files one by one. While it is great to have the option to resort to single handedly syncing files one by one, it may just be more convenient to select a couple of them and tell the computer to sync them.
And while Nautilus (the Ubuntu/Gnome file browser) seems to slowly get deprived of features, where are the glorious file browsers of times past; so I got myself Caja including the Caja-Actions configuration tool, and tweaked the file sync commands into a file action so I can now right mouse click any selection of files in the Caja browser’s directory display of the ODrive synced folder, and get the files to down- or upload (whichever is newer).
I put the rundown for the installation here for further convenience.
How to install ODrive client on Ubuntu 18.04 is described on the ODrive help pages [link] (only a practical small amount of all the options on how to proceed is listed here); one could copy / paste the commands into a terminal for example. Maybe consider to not run the setup as root unless you want the stuff in your root home ; ) ($HOME being relative to the user performing actions in the terminal):
Install on 32-bit Linux
od="$HOME/.odrive-agent/bin" && curl -L "http://dl.odrive.com/odrive-py" --create-dirs -o "$od/odrive.py" && curl -L "http://dl.odrive.com/odriveagent-lnx-32" | tar -xvzf- -C "$od/" && curl -L "http://dl.odrive.com/odrivecli-lnx-32" | tar -xvzf- -C "$od/"
Install on 64-bit Linux
od="$HOME/.odrive-agent/bin" && curl -L "http://dl.odrive.com/odrive-py" --create-dirs -o "$od/odrive.py" && curl -L "http://dl.odrive.com/odriveagent-lnx-64" | tar -xvzf- -C "$od/" && curl -L "http://dl.odrive.com/odrivecli-lnx-64" | tar -xvzf- -C "$od/"
To run the odrive Sync Agent server in the background, use the following command in your terminal:
nohup "$HOME/.odrive-agent/bin/odriveagent">/dev/null&
Now the odrive Sync Agent server is running and you can use the odrive CLI to control it. For example, the following command will display the available client commands:
Binary client
"$HOME/.odrive-agent/bin/odrive" -h
The following command will show the current status of the odrive Sync Agent:
Binary client
"$HOME/.odrive-agent/bin/odrive" status
Using odrive Sync Agent
1. Create an odrive account
If you don’t have an odrive account yet, get it here.
2. Create an auth key for odrive Agent
Once you have signed-in, navigate to your Authentication Codes and click on “Create Auth Key” to create an auth key that you can then use to authenticate your odrive Sync Agent install.
3. Authenticate odrive Agent: general format authenticate [auth key]
Linux binary client
"$HOME/.odrive-agent/bin/odrive" authenticate 00000000-0000-0000-0000-000000000000-00000000
4. Create an agent mount
This will mount the root of your odrive to the local folder “odrive-agent-mount”. Make sure the local folder exists before attempting to mount:
mkdir "$HOME/odrive-agent-mount"
You can then mount and see your odrive links listed in ./odrive-agent-mount: mount [local path] [remote odrive path]
Linux binary client
"$HOME/.odrive-agent/bin/odrive" mount "$HOME/odrive-agent-mount"
5. Sync an odrive folder:
Linux binary client
"$HOME/.odrive-agent/bin/odrive" sync "$HOME/odrive-agent-mount/ODrive.cloudf"(or any other *.cloudf file for download, or native file format for upload)
6. Sync a file
Linux binary client
"$HOME/.odrive-agent/bin/odrive" sync "$HOME/odrive-agent-mount/Dropbox/myfile.txt.cloud"
/home/test/.odrive-agent/bin/odrive
sync %f
If you want the home directory to be relatively encoded, i.e., instead of a hard coded path to a specific directory you would want to use “~/.odrive-agent/bin/odrive” to indicate the location of the odrive binary application, then you may have to change the execution mode of the action in the “execution” tab to not excute as “normal” but to use “display output”. I found that whereas the normal mode does not work, the display output mode works. Last but not the least, the display output mode is the one to use for trouble shooting – if you do not get a result from a sync desktop command, a verbal error message might help. And no, I have not yet really understood the size mismatch error ; )