How to Exclude Folders from OneDrive Sync on Ubuntu
Question details
The user wants to exclude specific directories (such as Documents or Videos) from synchronizing locally when using the OneDrive Client for Linux on Ubuntu.

- Product
- OneDrive Client for Linux
- Device & OS
- Ubuntu
- Scenario
- Syncing cloud files to a local Ubuntu machine while preventing large or unnecessary folders from downloading.
- Observed behavior
- By default, the client synchronizes all files and directories unless client-side filtering options like skip_dir or sync_list are explicitly configured.
Ensure you have the latest version of the OneDrive Client for Linux installed and that your default configuration file has been generated in your user directory (usually ~/.config/onedrive/config).
Configure Client-Side Filtering Using the skip_dir Option
The most efficient way to exclude whole directories from local synchronization is by updating the configuration file with the skip_dir parameter.
The OneDrive Client for Linux supports powerful client-side filtering. Modifying the main configuration file is the standard method to tell the client which directories should be ignored during the sync process.
Open your terminal and edit the OneDrive configuration file located at ~/.config/onedrive/config using a text editor (for example, run 'nano ~/.config/onedrive/config').
Locate or add the 'skip_dir' line in the file. Format it to include the folders you want to exclude, such as: skip_dir = "Documents|Videos".
Save your changes and exit the text editor. Finally, run the command 'onedrive --synchronize --resync' in the terminal to apply the new filtering rules.

Create a sync_list for Granular Control
If you have complex synchronization needs, using a sync_list file allows you to define exactly what to include or exclude line by line.
Edit Your Local OneDrive Files on Ubuntu with WPS Office
While managing your OneDrive synchronization on Linux, you need a robust, native office suite to open and edit your documents. WPS Office is fully compatible with Linux environments like Ubuntu, providing a lightweight, fast, and highly compatible alternative to Microsoft Office for all your local files.

Frequently Asked Questions
Why are my excluded folders still downloading during the sync?
If you previously synced those folders before adding them to the skip_dir list, you must run the client with the --resync flag (onedrive --synchronize --resync) to force it to read the new configuration and remove or ignore the previously synced directories.
Can I exclude specific file types instead of entire folders?
Yes, the OneDrive Client for Linux supports the skip_file option. You can add a rule like skip_file = "*.mp4|*.iso" to your configuration file to prevent the client from downloading those specific file types, regardless of the folder they reside in.
Where can I find more help for complex client-side filtering syntax?
For advanced configurations, troubleshooting, and detailed syntax examples, it is highly recommended to consult the official documentation in the OneDrive Client for Linux GitHub repository or ask questions in their GitHub discussions tab.




