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

Hi all,
In case it helps anybody, here is a simple recursive refresh script that will recursive run through all your directories and subdirectories and upload any files that might have been changed:
find ~/odrive-agent-mount/ -type d -exec python "$HOME/.odrive-agent/bin/odrive.py" refresh "{}" \;

(change ~/odrive-agent-mount/ to wherever your odrive is mounted)
schedule the task in cron on linux to run it every 15 minutes or so.

I did run into a strange issue where I renamed a folder and the text file in it, and the textfile didn’t upload anymore. Any new text files I added to that folder didn’t upload either. I tried to reproduce the problem with another folder but wasn’t able to. If anybody knows what the issue might have been, let me know!

1 Like

Just want to let folks know that we’ve released the CLI to the desktop client, which many have requested. I just added a blog post that dives into it a bit. The content in there also applies to Agent, so double whammy there. :slight_smile:

We also added a CLI section in our usage guide:

FYI, if you want parallelized recursive downloads, here’s a modification to the recursive oneliner mentioned above. If you have a LOT of files you’re trying to sync this will be much faster.

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

1 Like

stuckj,

I too am using xargs to parallelize the syncs. One useful tidbit, if you are saturating your internet connection, and want to ease off during work hours, you can fire a SIGUSR2 at the xargs process to tell it to reduce its parallelism by one, so hit it 9 times with kill -12 $(pidof xargs) (on linux) and any xargs processes will be reduced by 9 processcount.

When you are ready to ratchet it back up, use kill -10 $(pidof xargs) 9 times to get back to 10.

I’ve had a sync running for a few days and this way it doesn’t stop in the middle of a file, rather xargs just stops running the parallel job count when current jobs finish.

Thanks for the contributions @stuckj and @paradox606. I added them to the post:

How do I uninstall the Linux sync agent? I cannot find a command to uninstall this.

If you followed the instructions then the only 2 folders you would need to remove are:
~/.odrive-agent (which contains the application information)
~/odrive-agent-mount (which contains the odrive files/folders)

A post was split to a new topic: Peer to peer transfer capabilities (LAN sync)

In an attempt to declutter this thread a bit, I have moved a lot of the Questions and Troubleshooting to this thread:
https://forum.odrive.com/t/odrive-agent-troubleshooting-feedback-and-questions/1297

If you have issues or questions, please post there.

Thanks!

New release of Agent is available to bring it into parity with the fixes that have been released for the Desktop. We also now have a Raspberry Pi (ARMv6) compatible build!

1 Like

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: