Skip to main content

OneDrive ignore files

Project description

OneDriveIgnore

OneDrive sync settings are horrible! This script renames files so they can sync, and then switches back to original extension when you need them. Keeping everyone happy.

Reason for the script

Company I work for started to use OneDrive for MyDocuments, I don't particularly use that folder much since I do lots of scripting, and programming. OneDrive isn't the best for engineering purposes. I do have some folders I share that are on MyDocuments that I'd like to keep synced without deleting what's stopping the syncing. If you google "how to ignore a folder in onedrive" you'll get tons of discussions online about this issue.

See response from Angus over on OneDrive https://onedrive.uservoice.com/forums/262982-onedrive-archive/suggestions/6988070-use-a-file-to-ignore-exclude-files-or-folder

Recently my VSCode powershell extension complained about my package management being out of date, and installed it in MyDocuments. I figured just ignore this folder for Sync, but no, OneDrive removes the folder from the PC even if it originated from the PC, leaving me without my powershell package management.

Install

pip install onedrive-ignore

Usage

Create ignore_paths.txt file then place it in %userprofile%\.config\onedrive-ignore, and add one path per line to folders that are causing issues.

C:\Users\fernando\OneDrive\My Documents\WindowsPowerShell\Modules\PackageManagement\1.4.7\coreclr\netstandard2.0
C:\Users\fernando\OneDrive\My Documents\WindowsPowerShell\Modules\PackageManagement\1.4.7\fullclr

This script does a renaming of the file to txt file, then when restoring the files to original extension it simply removes the .txt.

onedrive --ignore
onedrive --restore

# Short version
onedrive -i
onedrive -r

Files Ignored, synced to onedrive:

Files_Ignored

Files Restored, OneDrive not syncing:

Files_Restored

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onedrive-ignore-0.0.4.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

onedrive_ignore-0.0.4-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page