Documentation also available here: https://docs.odrive.com/docs/odrive-sync-agent
- Overview
- Installing odrive Sync Agent
- Windows
- OS X
- Linux/RPi
- odrive Sync Agent quick start guide
- Available commands
- Helpful tips
- Direct download links
Overview
The odrive Sync Agent provides advanced users with a flexible, scriptable interface to odrive’s powerful Progressive Sync engine. Use it to bring cloud access to almost any environment.
The odrive Sync Agent can be used on Windows (7+), OS X (10.7+), Linux (glibc 2.11+), Raspberry Pi/ARMv6 (glibc 2.13+) operating systems.
####Sync Agent service (odriveagent/odriveagent.exe)
This is the “engine” and runs persistently. It will react to filesystem and remote changes and listen for commands from the odrive CLI.
####odrive CLI ( odrive.py/odrive/odrive.exe )
This is the client interface to the Sync Agent server. The odrive CLI is used from the command-line or from shell scripts to control and enhance Sync Agent behavior. The client is written in python and can be extended and customized to add additional functionality and automation, as well.
Installing odrive Sync Agent
##windows installation
Open up powershell and run the following command to download and install the odrive Sync Agent to .odrive-agent in your user home directory. This will download the odrive Agent service, the odrive Agent python client, and the odrive Agent binary client. The command doesn’t give much feedback, so just give it some time:
$o=“$HOME\.odrive-agent\bin”;mkdir “$o” -FORCE;(New-Object System.Net.WebClient).DownloadFile(“https://dl.odrive.com/odrive-py","$o\odrive.py”);(New-Object System.Net.WebClient).DownloadFile(“https://dl.odrive.com/odriveagent-win”, “$o\o.zip”);$shl=new-object -com shell.application; $shl.namespace(“$o”).copyhere($shl.namespace(“$o\o.zip”).items(),0x10);del “$o\o.zip”;(New-Object System.Net.WebClient).DownloadFile(“https://dl.odrive.com/odrivecli-win”, “$o\oc.zip”);$shl=new-object -com shell.application; $shl.namespace(“$o”).copyhere($shl.namespace(“$o\oc.zip”).items(),0x10);del “$o\oc.zip”;
To run the odrive Sync Agent server in the background, use the following command in powershell:
Start-Job { & “$HOME\.odrive-agent\bin\odriveagent.exe” }
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:
Python client
& python “$HOME\.odrive-agent\bin\odrive.py” -h
Binary client
& “$HOME\.odrive-agent\bin\odrive.exe” -h
The following command will show the current status of the odrive Sync Agent:
Python client
& python “$HOME\.odrive-agent\bin\odrive.py” status
Binary client
& “$HOME\.odrive-agent\bin\odrive.exe” status
Run the following command in your terminal to download and install the odrive Sync Agent to ~/.odrive-agent. This will download the odrive Agent service, the odrive Agent python client, and the odrive Agent binary client.:
od=“$HOME/.odrive-agent/bin” && curl -L “https://dl.odrive.com/odrive-py” --create-dirs -o “$od/odrive.py” && curl -L “https://dl.odrive.com/odriveagent-osx” | tar -xvzf- -C “$od/” && curl -L “https://dl.odrive.com/odrivecli-osx” | 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.app/Contents/MacOS/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:
Python client
python “$HOME/.odrive-agent/bin/odrive.py” -h
Binary client
“$HOME/.odrive-agent/bin/odrive” -h
The following command will show the current status of the odrive Sync Agent
Python client
python “$HOME/odrive-agent/bin/odrive.py” status
Binary client
“$HOME/.odrive-agent/bin/odrive” status
##linux/RPi installation
Run the following command in your terminal to download and install the odrive Sync Agent to ~/.odrive-agent. This will download the odrive Agent service, the odrive Agent python client, and the odrive Agent binary client.:
32bit Linux
od=“$HOME/.odrive-agent/bin” && curl -L “https://dl.odrive.com/odrive-py” --create-dirs -o “$od/odrive.py” && curl -L “https://dl.odrive.com/odriveagent-lnx-32” | tar -xvzf- -C “$od/” && curl -L “https://dl.odrive.com/odrivecli-lnx-32” | tar -xvzf- -C “$od/”
64bit Linux
od=“$HOME/.odrive-agent/bin” && curl -L “https://dl.odrive.com/odrive-py” --create-dirs -o “$od/odrive.py” && curl -L “https://dl.odrive.com/odriveagent-lnx-64” | tar -xvzf- -C “$od/” && curl -L “https://dl.odrive.com/odrivecli-lnx-64” | tar -xvzf- -C “$od/”
RPi
od=“$HOME/.odrive-agent/bin” && curl -L “https://dl.odrive.com/odrive-py” --create-dirs -o “$od/odrive.py” && curl -L “https://dl.odrive.com/odriveagent-rpi” | tar -xvzf- -C “$od/” && curl -L “https://dl.odrive.com/odrivecli-rpi” | 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:
Python client
python “$HOME/.odrive-agent/bin/odrive.py” -h
Binary client
“$HOME/.odrive-agent/bin/odrive” -h
The following command will show the current status of the odrive Sync Agent
Python client
python “$HOME/odrive-agent/bin/odrive.py” status
Binary client
“$HOME/.odrive-agent/bin/odrive” status
#odrive Sync Agent quick start guide
Now that you have the odrive Sync Agent installed and running, it is time to start playing with it!
-
Create an odrive account
If you don’t have an odrive account yet, you can get one here: https://www.odrive.com -
Create an auth key for odrive Agent
Once you have created an account/signed-in, navigate to odrive | Sign in and click on “Create Auth Key” to create an auth key that you can then use to authenticate your odrive Sync Agent install. -
Authenticate odrive Sync Agent
authenticate [auth key]
Python client
python “$HOME/.odrive-agent/bin/odrive.py” authenticate 00000000-0000-0000-0000-000000000000-00000000
_OS X/Linux/RPi binary client_
“$HOME/.odrive-agent/bin/odrive” authenticate 00000000-0000-0000-0000-000000000000-00000000
Windows binary client
& “$HOME\.odrive-agent\bin\odrive.exe” authenticate 00000000-0000-0000-0000-000000000000-00000000
-
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.
Do not use a local folder that is currently used/monitored by the odrive Desktop Client (if you are running both on the same system). Local paths for odrive Agent and odrive Desktop Client need to be separate:
mkdir “$HOME/odrive-agent-mount”
You can then mount and see your odrive links listed in ./odrive-agent-mount
>mount [local folder] [remote odrive folder]
_Python client_
>python "$HOME/.odrive-agent/bin/odrive.py" mount "$HOME/odrive-agent-mount" /
_OS X/Linux/Rpi binary client_
>"$HOME/.odrive-agent/bin/odrive" mount "$HOME/odrive-agent-mount" /
_Windows binary client_
>& "$HOME\\.odrive-agent\bin\odrive.exe" mount "$HOME\odrive-agent-mount" /
-
Sync an odrive folder
sync [path to .cloudf placeholder file]
Python client
python “$HOME/.odrive-agent/bin/odrive.py” sync “$HOME/odrive-agent-mount/Dropbox.cloudf”
OS X/Linux/RPi binary client
“$HOME/.odrive-agent/bin/odrive” sync “$HOME/odrive-agent-mount/Dropbox.cloudf”
Windows binary client
& “$HOME\.odrive-agent\bin\odrive.exe” sync “$HOME\odrive-agent-mount\Dropbox.cloudf”
-
Sync a file
sync [path to .cloud placeholder file]
Python client
python “$HOME/.odrive-agent/bin/odrive.py” sync “$HOME/odrive-agent-mount/Dropbox/myfile.txt.cloud”
OS X/Linux/RPi binary client
“$HOME/.odrive-agent/bin/odrive” sync “$HOME/odrive-agent-mount/Dropbox/myfile.txt.cloud”
Windows binary client
& “$HOME\.odrive-agent\bin\odrive.exe” sync “$HOME\odrive-agent-mount\Dropbox\myfile.txt.cloud”
authenticate - authenticate odrive with an auth key
mount - mount remote odrive path to a local folder
unmount - remove a mount
sync - sync a placeholder
stream - stream a placeholder eg. stream path | appExecutable -
refresh - refresh a folder
unsync - unsync a file or a folder
syncstate - get sync status info (blue text is Synced, Pink is Active)
status - get status info
deauthorize - deauthorize odrive to unlink the current user and exit
empty trash - empty odrive trash
shutdown - shutdown odrive
status also has the following flags for details:
–mounts get status on mounts
–sync_requests get status on sync requests
–uploads get status on uploads
–downloads get status on downloads
–background get status on background requests
–trash get status of trash items
–waiting get status of waiting items
–not_allowed get status of not allowed items
#Helpful tips
Detailed help
You can get more detailed help on individual commands. For example:
authenticate -h
Watch realtime status
Windows
while(1){& “$HOME\.odrive-agent\bin\odrive.exe” status;start-sleep -seconds 1}
OS X/Linux/RPi
while true; do “$HOME/.odrive-agent/bin/odrive” status; sleep 1; done
Logs
An odrive Sync Agent log file is located at “$HOME/.odrive-agent/log/agent.log”
Streaming
To stream a file, use standard piping commands such as:
“$HOME/.odrive-agent/bin/odrive” stream “placeholderPath” | “playerExecutablePath” -
On windows this works in cmd.exe, but not in powershell
Recursive Sync
Copy, Sync, Unsync Automation
#Direct download links
If you use the install instructions above you will get these versions
: Agent/CLI (Linux, MacOS, Win)