-
Notifications
You must be signed in to change notification settings - Fork 36
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
Windows Samba shadow copy & pyznap - can it be done? #41
Comments
I'm not really familiar with samba and shadow copies. But would it not be possible to use regex to match the snapshot names? Something like
as user @benpye suggested. Rewriting pyznap to have custom labels will take a bit more work and I would like to avoid that :). |
Did this work? Or do you have any new info? Else I will close this. |
I can't test it yet so I'm not sure. If you'd like to close it go ahead, I'll try to test this later when I can, I'm sure it should work as you described. |
Can you reopen this issue please? I believe windows shadow copies don't like that U are using ':' in the snapshot names.
Is there any way we can easily change the snapshot naming format ourself? |
No, atm there is no way to change the snapshot naming. There is a PR (#39) to allow this, though atm I'm not comfortable to merge this, as there are some problems and no comprehensive tests. You could try to run that version locally. |
Thank you for your quick response ! Could you guide me on how I can get the commit from @chazapis running on my system? |
Just copying over the files might break something, as there is a merge conflict between the most recent pyznap version and that PR. You can do the following:
This will download his branch to your |
I have done some testing myself and it turns out we can't use Windows Shadow Copies on Samba due to the naming of these snapshots. There is not option in SAMBA to catch the snapshottype (hourly, frequent) on the end of the snapshot name. Does anybody know how we can change the code to put the snapshottype in front of the data/time? |
This here
does not work? Changing the code to put the type in front of date&time is a major change and might not be so easy. pyznap relies on being able to match the snapshots with |
@DeViLRuNNeR-dev take a look at the options of the shadow copy Samba module ( https://www.samba.org/samba/docs/current/man-html/vfs_shadow_copy2.8.html). You can change the format Samba expects, to what pyznap provides, with |
I have tried several things and whatever I do I cant' get it to work with a variable like _daily or _frequent appended @ the end. Does anybody have it working with the snapshot type in the end? |
Just a little update !
|
I couldn't get it to work either - I'm going to try your new code and see if that works. Did you have any other lines regarding shadow copy in your conf file as well? |
My full smb.conf ` [homes] [DATA]
Hope is helps you getting it working ! |
@DeViLRuNNeR-dev not sure I fully understand - does this work with one specific snapshot name or all of them? This still only works with ONLY frequent, or ONLY daily snapshots right? Or are you saying it works with all of them? |
It works with all of them ! |
EDIT: You full smb.conf has an error, it should be this line for the prefix format: Which is what you said earlier. I can confirm it works! @DeViLRuNNeR-dev why do you not allow for local time? Wouldn't it be easier for users to see the actual local times of the files they are trying to restore? |
@recklessnl Great you got it working to ! Maybe it has something todo with my release of samba on debian ? |
Thx mate, that worked great (Ubuntu 20.04) smb.conf:
|
Hi, I'm looking at pyznap and it looks solid. One thing that I would love to have as a Windows user though is to enable shadow copies with ZFS. Which basically allows any Samba share file and directory to restore to Previous Versions using a super simple GUI. This is all in Windows - and would be supported by the ZFS snapshot mechanism (and thus, pyznap).
See: https://blog.chaospixel.com/linux/2017/09/zfs-auto-snapshots-and-windows-shadow-copies-with-samba.html
Also this thread on the same issue with zfs-auto-snapshot: zfsonlinux/zfs-auto-snapshot#84
Is this possible with pyznap as well? If so, how would you do it? And if not, would you be able to add code in order to make this work? Would be really great.
The text was updated successfully, but these errors were encountered: