3

I use OneDrive to sync a script between multiple computers, including between my home and work machines. At work, we recently implemented separate logins for normal vs. admin access. This caused a problem because my script requires running under admin rights, but my admin account doesn't have access to my normal account's document folders where OneDrive syncs. I initially got around this by just manually copying the scripts between the sync location and one where the admin account can reach.

I next tried using a hardlink on my work computer, set up where the original file was in the sync location and the hardlinked version was in the outside folder. This worked great when I made changes to the script from my work machine, but I recently found that if I make changes on my home machine it breaks the hardlink. It seems that the process of OneDrive syncing the files works as a delete and re-add, so the delete step breaks the hardlink. The script continues to work because the "linked" file now becomes a standalone file.

Can anyone think of a way to keep these syncing, or a better way to do the same thing? I don't think there's a way to change the hardlink behavior because that seems to be integral to its design. OneDrive syncing a single file to a different location than the rest would be ideal, but I haven't found a way to do that.

1
  • Heard about Duplicati ? After OneDrive limits started to obstruct my work, I resorted to this tool and works pretty well. You can try it. Not affiliated to them in any way
    – clhy
    Apr 30, 2018 at 7:30

1 Answer 1

0

It's been more than 2 years and I don't know if you have resolved it...

My solution is similar to your second try. Instead, I put the original directory under Onedrive folder and make a Junction outside.

The reason why I don't do it in a reversed way is it will make the onedrive always at 'syncing' status. (I guess that's because the files under onedrive folder are actually 'reparse point'. If they are outside the onedrive folder, onedrive cannot change their header information).

see: https://en.wikipedia.org/wiki/NTFS_reparse_point

OneDrive tags the files and directories it has downloaded to the local storage as a reparse point with tag 0x9000001a. The actual data is stored normally.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .