Hi @ugloo,
It does look like syncstate has a listing issue with large folders. I am seeing truncation of the items in a 700 items folder and it only showing about 300 items. This is something we will need to look at.
The very first item is the state of the path you selected. So if you do this on a folder, the first item will be the state of the folder. This is as its tracked in odrive, so it isn’t influenced by the listing truncation above.
Can you tell me what information you are trying to gather? We can work around the limitation here, but I would need a bit more info on the use case.
Thanks for your answer.
I want to be sure that when I have a “synced” status for a directory path, it is about the directory himself and its subdirectories and files.
Hi @ugloo,
The folder syncstate can be deceiving because it can say “Synced” if there are placeholder files in the structure. This is because an odrive folder is considered “Synced” if there are no files in it to upload.
To get a listing of all files/folders that have not been downloaded/expanded yet within a folder structure, you can run this command: path="$HOME/odrive-agent-mount"; find "$path" -name "*.cloud*"
To get a listing of all files that have not been uploaded yet within a folder structure, you can run this command: path="$HOME/odrive-agent-mount"; odrive_cli="$HOME/.odrive-agent/bin/odrive.py"; find "$path" -type f -not -name "*.cloud*" -print0 | xargs -0 -n 1 -P 4 python "$odrive_cli" syncstate --textonly | grep "Not Synced"
To get a report of all files/folders that have not been downloaded or uploaded yet within a folder structure, you can run this command: path="$HOME/odrive-agent-mount"; odrive_cli="$HOME/.odrive-agent/bin/odrive.py"; echo "Not uploaded yet:"; find "$path" -type f -not -name "*.cloud*" -print0 | xargs -0 -n 1 -P 4 python "$odrive_cli" syncstate --textonly | grep "Not Synced"; echo "Not downloaded yet:";find "$path" -name "*.cloud*"
path="$HOME/odrive-agent-mount" can be changed to a specific folder in odrive, like path="$HOME/odrive-agent-mount/Amazon Drive/My Folder"
odrive_cli="$HOME/.odrive-agent/bin/odrive.py" shoudl be changed to where you have stored the CLI.
It looks like this cli version “https://dl.odrive.com/odrive-py” is the good one for us. Before, we were using the binary version.
Currently, we write results of the syncstate command inside a file by redirecting output, but some errors happened during file writing. We had to overwrite “sys.stderr.write / sys.stdout.write” functions to do that :
Thanks for the update @ugloo! I am always interested in how people are using the product, especially in these more advanced cases.
If you are able to share your workflow/scripts/further CLI modifications here, I (and I’m sure others) would be appreciative. Only if it is possible and you are comfortable with it, of course. I realize there may be pieces that are sensitive/private and cannot be shared.