Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seemingly Kopia locks files when it is backing them up #2662

Closed
LinuxOnTheDesktop opened this issue Dec 29, 2022 · 6 comments · Fixed by #3543
Closed

Seemingly Kopia locks files when it is backing them up #2662

LinuxOnTheDesktop opened this issue Dec 29, 2022 · 6 comments · Fixed by #3543
Labels

Comments

@LinuxOnTheDesktop
Copy link

Thus, I saw the following - and discovered that a scheduled Kopia job was running:

image

This is bad, because (1) the user might be confused, at least initially, and (2) if the user wishes to proceed with the deletion, she will either have to wait or else abort the backup job.

Windows 10 Pro - 22H2 (2009: 19045)
Kopia 0.12.1

@wildyaboku
Copy link

If kopia doesn't lock the file, then the user will be able to modify it while the backup is being created. This can cause corruption. It's much better to have a confused user than a user who unexpectedly loses their data.

A solution for this is to enable Volume Shadow Copy so kopia can instead backup a snapshot of the files which is safe from modification: https://kopia.io/docs/advanced/actions/#windows-shadow-copy

@LinuxOnTheDesktop
Copy link
Author

Thanks. Am I to take it that at present Kopia does not use the shadow-copy mechanism unless one invokes that mechanism manually by dint of a script?

@LinuxOnTheDesktop
Copy link
Author

I should add: the point of the shadow-copying is to allow a user to keep using files that are being operated upon. Without that functionality, a backup tool gets in the way of the user.

@wildyaboku
Copy link

I've found a PR to add this as a built-in feature: #2334 - The only caveat is that VSS will require Kopia to be run as administrator on Windows.

The primary goal with Volume Shadow Service (VSS) is to take a snapshot of the filesystem at a specific point in time from which the backups can then work. This ensures data consistency – during the backup process, it eliminates the risk of queued files being hydrated with newer data than those which have already been saved.

As side effects, VSS will allow files to be included in the backup even if they are read-locked, and will allow you to continue creating, modifying, or deleting files on the volume without affecting the backup. These of course are very welcome side effects and will make for a very exciting addition to Kopia.

@LinuxOnTheDesktop
Copy link
Author

@wildyaboku

Great! Do you have the power to pull-in that PR? Also, the running as admin: how will that work if one has Kopia set to auto-start?

@wildyaboku
Copy link

No, I'm not a contributor to this repo. We'll need to wait for @jkowalski to review the PR, he seems a bit inactive recently.

KopiaUI won't auto-start with admin escalation. It currently works by adding a string to the registry under HKCU\Software\Microsoft\Windows\CurrentVersion\Run which does not have an option to start as admin. It would be fairly simple to run Kopia on startup with admin privileges using Task Scheduler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants