Odrive Sync Agent: A CLI/scriptable interface for odrive's Progressive Sync Engine for Linux, OS X, and Windows

5 posts were merged into an existing topic: Odrive Agent/CLI Troubleshooting, Feedback, and Questions

This is great.
Is there a way to run the sync agent on a ArmV7 system like a Drobo 5N ?

Hi @maisumgajo,
We have an ARMv6 build available. It requires glibc 2.13+: https://docs.odrive.com/docs/odrive-sync-agent#section--install-sync-agent-on-linux-rpi-

We haven’t tested it on Drobo, but it could work.

Hello guys!
I’m just wondering if there its a possibility to do some video tutorials about:

  • how to instal Odrive Sync Agent on different platforms
  • how to use
    and the most wanted video tutorial for me will be -
    - different tips and trick which you can do with Odrive Sync Agent

Unfortunately the current drobo 5N OS ships with GLIBC 2.11.1 .
Doesn’t look like it works.

Thanks for the update @maisumgajo. I thought that might be the case. :frowning:

Hi there I am very happy with this tool. I want to advise all that I have tryed the BACKUP function.
IT WORKS !!! The Command should be passed like so :
python “$HOME/.odrive-agent/bin/odrive.py” backup “temp/” “/OneDrive For Business/”

The explaination is : “temp” should be your local folder to save and “/OneDrive For Business/” the Absolute Path for the Remote Folder on your One Drive For Business Storage. So if you have Dropbox change it into “/Dropbox”

To make it scriptable you can fix the Tony’s one :

#!/bin/bash
agentdir="$HOME/.odrive-agent/bin"
export agentdir
agentmount="$HOME/odrive-agent-mount/OneDrive For Business/“
targetdir=”$agentmount/temp"
sourcedir="$HOME/downloads/test_directory"

cd “$agentmount”;
echo “CHECKING odrive mount point …”; sleep 2;
if [[ $(python “$HOME/.odrive-agent/bin/odrive.py” status | grep “Mounts: 1”) ]]; then echo “MOUNT FOLDER CORRECTLY MOUNTED”; else echo “Please Mount odrive Folder … Aborting Script”; exit 1; fi

cp -R “$sourcedir” “$targetdir”;

echo “STARTING THE BACKUP …”

python “$HOME/.odrive-agent/bin/odrive.py” backup “temp/” “/OneDrive For Business/”

exit 0

Hi @ciro.pappada,
I saw you posted this here in addition to the feature request thread. I am adding a reference to my comments over there, for the benefit of those who hit this thread but not the other:

Thx Tony for your reply ! About the backup function that it’s at a very first-stage … I’ll keep that in mind when testing it.
Anyway I am very happy about the very powerful sync too.
I think for all people needing a quick cloud backup they can use the sync option as you suggested some post before. Very Important :
You’ve probably already explained but I’m writing here two words on what does “sync” and “unsync”.
“Sync” needs a placeholder “.cloud” for already existing files and “.cloudf” for already existing folders.
When you call the sync it will transform your placeholder into your real file or folder inside your mount folder.
When you call the unsync you need to call the “unsync” function with your real local filename or foldername.
Now the unsync will transform your file/folder back into a placeholder .cloud or .cloudf.
This way you’re not synced anymore ! If you need you can resync later to update your datas.
Now I’ve ended up using “sync” for placeholders and later “unsync” files, like you suggested as backup ! :wink:
Thx again

1 Like

recursive sync for cli on windows, edit your location:
put bat file in the folder where odrive.exe is.
.cloudf are folders, .cloud are files, obviously.

@echo off
cd /d %~dp0

for /r E:\odrive\OneDrive\temp-sync %%i in (*.cloudf) do odrive.exe sync "%%i"
for /r E:\odrive\OneDrive\temp-sync %%i in (*.cloud) do odrive.exe sync "%%i"
1 Like

Thanks @bojandjuric!

We haven’t had anyone contribute a pure batch script yet. I’ve added it to the “recursive examples” post here:

Hello, can you perhaps give me a hand? I am trying to create a “unsync everything” script on Linux. It just doesnt work, even though it is probably very easy to do… Thanks!

Hi @amdamdes,
Are you trying to unsync all of the files, but leave the folders? What have your tried so far?

exactly, I wold like to unsync the whole odrive, but keep the folders.

Hi @amdamdes,
Something like this should work:

exec 6>&1;num_procs=4;output="go"; while [ "$output" ]; do output=$(find "$HOME/odrive-agent-mount" ! -name "*.cloud*" -type f -print0 | xargs -0 -n 1 -P $num_procs "$HOME/.odrive-agent/bin/odrive.py" unsync | tee /dev/fd/6); done

This would unsync all files under the odrive-agent-mount using 4 concurrent processes.

OMG, how cool! thank you so much!

Whoops, I noticed a typo above. It said sync vs unsync. I corrected it. Taking another look I think this can be simplied, so give me a minute or two.

1 Like

Here is the simplified version:

num_procs=4;find "$HOME/odrive-agent-mount" ! -name "*.cloud*" -type f -print0 | xargs -0 -n 1 -P $num_procs "$HOME/.odrive-agent/bin/odrive.py" unsync

Tony sent me this great script to sync all folders:
exec 6>&1;num_procs=2;output="go"; while [ "$output" ]; do output=$(find "[path to odrive folder to sync here]" -name "*.cloudf" -print0 | xargs -0 -n 1 -P $num_procs python $(ls -d "$HOME/.odrive/bin/"*/ | tail -1)odrive.py sync | tee /dev/fd/6); done

… but after running it again, I no longer get the 'real time output.'
Any idea why? It works, but no logging of items in Terminal.