Consistent backups in python
Asked Answered
B

3

8

I'm working on a remote backup solution in python. The server part will run on Unix/Linux because it will use hard links for efficient incremental backups.

The client part, however, will have to run on Windows too, and file locking can be a problem.

From what I've researched, Volume Shadow Copy Service (VSS) is the thing I need. Similar to a LVM snapshot, and isn't affected by file locking. THe VSS API, however, doesn't seem to be implemented in pywin32.

My current idea is to use some wrapper that will create the a temporary VSS snapshot, run the client, and delete it afterwards.

I'm wondering if anyone has experience in this scenario.

Beaudry answered 29/11, 2012 at 10:55 Comment(2)
I once used a batch file that rar'd a folder using the name of the pc and the date/time and sent it by ftp to the server. This was before VSS existed.Ingles
The issue is not copying the files to the remote server. That's working fine, unless a file to backup is opened by another process. That's what I want VSS for.Beaudry
L
2

Wondering about the same I stumbled upon

https://github.com/sblosser/pyshadowcopy (simple, but seems no longer active)

and

https://github.com/libyal/libvshadow (complex, ambitious, alpha)

Unfortunately I didn't have time to test them yet...

Luciferin answered 8/3, 2016 at 8:38 Comment(1)
Thanks... both seem promising... i'll have a look at themBeaudry
S
0

I would look into IronPython on your Windows client side. Simply because this will give you access to COM+ DLLs and other WinAPI objects. It's .NET, but it would still be python. I've not used it enough to say for 100% certainty it will work with VSS, but it should.

Subrogate answered 29/11, 2012 at 12:21 Comment(0)
G
0

While looking for the same thing for my personal backup tool, I came across PyVSS. Which seems to be simple to use, however, there is only compiled version of the module available. Essential source code parts are missing.

Gossamer answered 20/5, 2013 at 15:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.