CLI Guidelines to Sync Entire Folder Contents

Hello,

I am searching for a way to utilize the CLI to sync an entire folder’s contents. I have everything lined up on a raspberry pi, but I have to keep typing in individual file names to sync. Is there any way to wild card file names or something to avoid have to manually sync each file by name?

Any help would be appreciated.

Thanks,

Brian

1 Like

Hi @brian.michaud1,
If you want to recursively download an entire folder (and its subfolders) you can use the following command. This assumes you installed using the steps in our documentation ( https://docs.odrive.com/docs/odrive-sync-agent#section--install-sync-agent-on-linux-rpi- ):

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

This will download everything, recursively, in “$HOME/odrive-agent-mount/path/to/folder/here” using 4 threads. You would need to replace “$HOME/odrive-agent-mount/path/to/folder/here” with the path to the folder you are trying to sync.

1 Like