OneDrive forces the user to store documents in the Onedrive folder. This does not offer the liberty of preserving folder structure for projects like a local development environment backup.
Create a symbolic link to the OneDrive sync directory. This is detailed here and as tested works well.
Simply open an elevated command prompt and add the appropriate directives to the command line below.
mklink /J “C:\Users\\OneDrive\” “C:\”
C:\Windows\system32>mklink /J "C:\Users\XXXXXX\OneDrive\Python" "C:\Users\XXXXXX\AppData\Local\Programs\Python"
where XXXXXX is the useraccount directory.
Allows a robust option to backup files automagically that doesn’t require continual attention. Follows the mantra: automate the boring stuff (anything that humans have to do repetitively is better achieved by a computer).