Share via

How to synchronize Ubuntu with OneDrive but at the same time exclude some certain directory?

Anonymous
2024-01-14T14:37:31+00:00

Hello community,

Brief background:
I am using Ubuntu 22.04.3 LTS for Windows 11 in my laptop.
I downloaded OneDrive in Ubuntu and now I want to synchronize it.

The problem: The problem is that, I have several folders in my OneDrive cloud, and one of those folders weights way too much (31GB) and I don't want this folder to be synced in my ubuntu. In other words, I want my Ubuntu machine to clone all the files and folders that present in OneDrive but with an exception of one specific directory located at Documents/Videos which should not be installed in Ubuntu.

**What I did:**In order to synchronize Ubuntu with OneDrive, I used the following command:

$ onedrive --synchronize

This command downloads everything which presents in OneDrive including the Documents/Videos folder.

Basically, I want my Ubuntu to always be up to date with OneDrive changes, while ignoring **** that 'videos' folder, because it weights too much. I would appreciate any help.

Microsoft 365 and Office | OneDrive | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2024-01-14T17:48:32+00:00

    Hello Abubakr S, thanks for coming into the forums. I'm Myk, an Independent Advisor and I'll be more than happy to help you.

    Unfortunately, the OneDrive client for Linux does not currently support excluding specific directories from sync. However, you can work around this by syncing each directory individually, excluding the Documents/Videos directory. Please note that this will require you to run the onedrive --synchronize --single-directory command for each directory you want to sync.

    You may use the --synchronize --single-directory command to sync a specific directory. For example, if you have a directory named “Personal” in your OneDrive root that you want to sync, you may use the command onedrive --synchronize --single-directory "Personal" . If you require any further information, then please don’t hesitate to get in contact. I will be more than happy to assist you further.

    Kind Regards, Myk

    7 people found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-01-18T06:28:49+00:00

    @Abubakr Shoaliev

    I am the developer of the OneDrive Client for Linux (https://github.com/abraunegg/onedrive)

    > Basically, I want my Ubuntu to always be up to date with OneDrive changes, while ignoring **** that 'videos' folder, because it weights too much. I would appreciate any help.

    What you want to do is a 100% core feature of the client. This is known as 'Client Side Filtering' which allows you to skip certain files or folders that you desire to not be required client side.

    Please read the documentation on the following configuration options:

    * skip_file

    * skip_dir

    * sync_list

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-01-18T06:30:03+00:00

    @Abubakr Shoaliev

    Rather than asking your questions here, please ask your questions on GitHub: https://github.com/abraunegg/onedrive/discussions

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2024-01-14T18:23:17+00:00

    Hi,

    You will need to run it manually every time there is an update that you'd like to sync in the Ubuntu machine. Extra steps indeed, but as long as the unwanted OneDrive folder is not synced to it, it will keep your storage consumption low.

    Kind Regards, Myk

    Please, remember to give back to the community. Help the next person with this problem by rating how this conversation was helpful.

    0 comments No comments
  4. Anonymous
    2024-01-14T18:14:22+00:00

    Hello, @Myk Ylaya

    Thank you for your reply, your alternative solution worked for me. However, I have one more small question: does this mean that whenever some changes are made to my OneDrive files, I have to run onedrive --synchronize command every time to make those changes appear in my ubuntu machine? I am asking that, because initially my goal was to do alterations in OneDrive files through my Windows laptop and have all those modifications immediately appear in my Ubuntu machine. I am not sure if it is possible to make ubuntu always sync with the cloud. Thank you!

    0 comments No comments