Trying recursive download script example

Hello, I’m trying the recursive download script example here: How can I force a recursive download with the CLI?

Note that I’m on Ubuntu18.

It was originally giving me errors, and I made some modifications. But alas, I guess I’m having some trouble understanding a portion of the script. Wondering if there are any more recent versions of this?
exec 6>&1;num_procs=3;output=“go”; while [ “$output” ]; do output=$(find “/home/shorton/odrive-agent-mount/” -name “.cloud” -print0 | xargs -0 -n 1 -P $num_procs python $(ls -d “$HOME/.odrive-agent/bin/”*/ | tail -1)/home/shorton/.odrive-agent/bin/odrive.py sync | tee /dev/fd/6); done

shorton@shorton-NV79:~/odrive-agent-mount$ ~/Downloads/odrive/download_amazon_cloud.sh
ls: cannot access ‘/home/shorton/.odrive/bin/*/’: No such file or directory
usage: odrive.py sync [-h] placeholderPath
odrive.py sync: error: too few arguments

thank you

Hi @shorton3,
The command you are using was geared towards the MacOS install, so it will need to be changed a bit for Linux. Try this:

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

Keep in mind that this will sync everything in your sync mount.

Thanks Tony; this ran and appeared to perform a full download / sync of all folders in the amazon drive account. If I run it a 2nd time (to check if anything else needs to be downloaded), there are no more remaining .cloud files (I ran ‘find’ manually), and this command gives:
usage: odrive.py sync [-h] placeholderPath
odrive.py sync: error: too few arguments

Is this what you expect it to output? If so, per my understanding, if I wanted to download a new deltas, I would need to mount again and start over, or is there a command (or update script) to ‘update’ this already mounted location?

Thank you

Hi @shorton3,
odrive will automatically detect remote changes and create placeholders for those. You can test this out by adding some files to Amazon Drive account through their web client or the odrive web client.

Remote changes on Amazon Drive should be picked up within a few minutes by the odrive sync engine. If you run the same script again, it will sync those.

The output you see when everything is already synced is expected. It is getting this message because the find command is not finding any placeholder files, so the output feeding into the odrive.py command is empty.

Thank you for clarifying
-stephen

1 Like