Linux (using cli): how to sync (and keep it synced) a selected folder and all its content

Hi @william.melatini,
odrivecli will not perform recursion on its own but the script can. Make sure the folder you want to recursively sync has been synced once so that you are performing this on an actual folder and not a placeholder. Since the command is using find to recurse through the structure, it needs to start with a real folder.

This is the command I use on my own system:
date; exec 6>&1;num_procs=4;output="go"; while [ "$output" ]; do output=$(find "[insert path of the folder you want to sync]" -name "*.cloud*" -print0 | xargs -0 -n 1 -P $num_procs "$HOME/.odrive-agent/bin/odrive" sync | tee /dev/fd/6); done; date

For [insert path of the folder you want to sync] replace that with the full path to the folder you want to sync. Again, make sure that folder is not still a placeholder (.cloudf). For example, if you wanted to sync all of the content in the folder /home/ubuntu/odrive/Amazon Cloud Drive.cloudf You would perform these steps:

  1. Run: "$HOME/.odrive-agent/bin/odrive" sync "/home/ubuntu/odrive/Amazon Cloud Drive.cloudf"
  2. Run: date; exec 6>&1;num_procs=4;output="go"; while [ "$output" ]; do output=$(find "/home/ubuntu/odrive/Amazon Cloud Drive" -name "*.cloud*" -print0 | xargs -0 -n 1 -P $num_procs "$HOME/.odrive-agent/bin/odrive" sync | tee /dev/fd/6); done; date
1 Like