So on my Mac or windows machines, I have the ability to sync any folder on my system, not just in the oDrive tree, and then unsync it. All the instructions I’m seeing online for the Odrive sync agent show examples from the odrive-agent mounted directory, but in my case I have about a TB of pictures and home movies that I really don’t want to move around if I don’t have to. How can I tell the oDrive command line agent to sync this directory that is not already a .cloudf placeholder?
You can setup “sync to odrive” folders on Linux by creating additional mounts. The first mount you create with the odrive agent is the “default” odrive folder, but you can create additional mounts as long as you have a Premium subscription.
mount [local path] [remote odrive path]
So to interpret that (because I’m trigger shy), thats odrive mount ~/AllMyPictures /MyCloudMountpoint and it will just start synchronizing it?
The layout would be something like
(no .cloud or .cloudf files here yet)
In this scenario, would it be smart enough to leave the identical files alone (create .cloudf stubs) and only sync folder 3?
Here’s an example of what I’ve been doing so far to sync stuff in linux because I’ve been worried to mount in place for fear of trash canning either a lot of cloud pics OR a lot of local ones.
Set new line as the only break in find loops. (Good for spaces in filenames)
## Define the two locations to compare.
ODriveFiles=$(ls -1 $SYNCDIR | sed -e 's/\.cloud\|\.cloudf//') PicFiles=$(ls -1 $SOURCES) }
nohup “$HOME/.odrive-agent/bin/odriveagent” > /dev/null 2>&1 &
odrive mount $SOURCDIR $CLOUDPATH
diff -u <(echo “$ODriveFiles”) <(echo “$PicFiles”) | grep ^+ | grep -v “/dev/fd” | cut -d + -f 2 > /tmp/differences
for i in $(cat /tmp/differences);
do rsync -av $SOURCES"$i" $SYNCDIR;
while [ $(odrive syncstate $SYNCDIR | head -n 1) = “Active” ]
odrive status --uploads
for j in $(cat /tmp/differences);
do odrive unsync $SYNCDIR"$j"
odrive unmount $SYNCDIR
Sequence the actions
In this case it will compare both sides and determine what needs to be synced. In most cases that means that files that already exist on the remote side will be marked as syced without having to upload anything. Anything local that has not been uploaded yet, will be. Anything on the remote side that is not on the local side will show as a placeholder file.
I don’t see $SOURCDIR defined. Is that supposed to be
odrive mount $SYNCDIR $CLOUDPATH?
In any case, with a “sync to odrive” folder (additional mount), you can forego the rsyncing between two folders and just sync the folder directly.
What you caught was a rename on the fly that I didn’t like and intended to rename also in the source script I copied it from :P.
I’ve been testing the way you described and so far it’s been working like a charm. only showing One file/directory as “not allowed” that I need to figure out.
Thanks so much for the continued great support! I really do enjoy Odrive and speak of it often with my colleagues. Really looking forward to B2 r/w and more one-way backup capabilities! Keep up the great work!
Also, my wife (whom said pictures belong to) asked me to plug that a GUI companion to odrive on linux would be “awesome sauce”.
You can use the
status --not_allowed command to see if there is additional information about that item.
Thanks for your patience and for being an odrive user!