I am backing up user directories under Windows. As such I typically get the following errors:
failed to open source object: open \?\c:\users\public\ntuser.dat.LOG2: The process cannot access the file because it is being used by another process
2018/01/07 14:01:04 ERROR : : error reading source directory: CreateFile \?\c:\users\public\Recent: Access is denied.
2018/01/07 14:00:40 ERROR : Encrypted drive ‘encrypted:/public’: not deleting files as there were IO errors
How do I tell rclone sync that I want to delete remote files in spite of these errors?
Better, how do I suppress each kind of error? Specifically, I never want “process cannot access the file because it is being used by another process” to prevent remote deletes.
I also don’t know how to suppress the error for c:\users\public\Recent. I don’t actually understand what is wrong there as I seem to have read-access (from Explorer).
There isn’t a way of doing that at the moment. But what you can do is use --exclude to exclude the file names - that is what I’d do.
I can’t predict which files will be locked ahead of time. It depends on what application the user has open at a given time.
I also don’t know how to suppress the error for c:\users\public\Recent. I don’t actually understand what is wrong there as I seem to have read-access (from Explorer).
Is that a special directory of some kind? (not a Windows expert)
It looks like rclone can’t access any junctions, even though it’s running under my user and I have no problem accessing these junctions manually. Do you have a Windows box (even in a VM) to reproduce/debug this problem? I think you will need to add explicit support for junctions.
I don’t know if Shadow Copy ( https://en.wikipedia.org/wiki/Shadow_Copy ) might be useful here; I’m not a Windows person but I would think about using this to create a snapshot and then rsync the snapshot.