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!
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.
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
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.
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)
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!
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/”
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: