-
Notifications
You must be signed in to change notification settings - Fork 251
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
Integrate shadow copy snapshots for Samba #10
Comments
This is easily done in Samba4 with the latest zfsonlinux by setting
|
@FransUrbo is working on Samba registry shares in his smbfs_registry-shares branch, which seems like the best way to automate this kind of thing. Perhaps this could be implemented as a |
I have modified zfs-auto-snapshot for my own use to address this problem. Instead of embedding the 'label' in the snapshot name (eg, zfs-auto-snap_hourly-...), I put it in a zfs properly. I also modified the code that cleans up old snapshots to examine this property. It's passed in the SNAPSHOTS_OLD list so it should be just as fast. I would be glad to provide this code if there is any desire to integrate it into the standard distribution. But I think making this behaviour parametric -- ie, controlled by an argument or config value -- would significantly complicate the otherwise clean code. |
@leecallen, certainly. Post the code to a fork of this repository if you want to float an idea. This will make it visible to people that are already watching this repo and not put anything permanent into the ticket history. |
I have never done that before - submitted a change (fork) to a github project. Do I flag my changes, or will my system automatically detect changes using diff? Is there anything else I should know? (I found the basic 'howto' under Help). |
On Feb 3, 2014, at 5:30 PM, leecallen wrote:
One note though. If upstream have done a lot of changes (let's say ten commits), What you do then, is a 'git rebase origin/master' (or whatever the upstream And you can always 'take back' (delete) your pull request if it doesn't look ok. Oh, and another thing you might want to consider: push your changes to your even after the pull request have been accepted).System administrators motto:
|
Done. Thanks for the help guys. |
One can expose all weekly, monthly, hourly snapshots into windows if you're clever with the snapshot naming.. use a number system such as 01, 02, 03 ,04 for week/mon/hour/day etc.. then use the format property to interpret that label as part of the date-time vfs objects = shadow_copy2 too easy :) |
Well that is really very clever. I will try it as soon as I get a chance. On Sat, Jun 21, 2014 at 9:01 AM, ArakniD [email protected] wrote:
Lee Allen |
Sure have.. use it on my home NAS.. mainly to prevent my wife from deleting my shit :) I've also had to patch the main script to purge old snapshots by their tag name.. so If I say keep 8 hourly.. it only removes HOURLY snapshots.. keeping 8 of them only.. this way you can say, keep 8 hourly... 7 daily 4 weekly and 6 monthly? a fairly good snapshot regime I think I posted this under another issue too.. enjoy :0 |
I created some instructions in the wiki how to use shadow copies with Samba. Can someone merge the |
@stuehmer, the work by @leecallen was merged into a topic branch, but ZoL itself didn't get tight Samba integration. I will revisit this issue when I do a mid-series update for Ubuntu 15.04 Vivid. |
Hi all, thanks before. I need some help about destroy snapshot. And I need to delete/destroy the old one list "zfs-auto-snap_daily-2016-05-01-2336" |
There is a --keep option. I label mine with 01, 02, 03 etc so that samba can take format and use it as the date milliseconds, but then allow the auto snap script to use the tag to destroy only the older snapshots in THAT list. Not just the oldest one.. I'll dump my commands when I get behind a terminal |
this is my crontab
This will create snapshots that look like
which if you use samba and the "previous versions" tabs, then configure smb with;
Then you can have seperate lists of snapshots which are kept on different queue depths. Success. |
Hey @ArakniD , thanks for your tips in this thread! I've mostly got shadow copies working now on my server. Right clicking on the share on my windows box, I can see the snapshots listed in the Previous Versions tab, but when I try to open one, I'm getting a "You do not have permission to access \server\tank\share@GMT-date-time" error. I'm thinking this might be due to the permissions set on snapshots created by the zfs-auto-snapshot script? Have you (or anyone else reading this!) had to modify permissions or tweak the script in any way to be able to browse snapshot contents on a windows client? Edit: Well, I went back to trying to figure out how to make this work after a few days' pause... and, funnily enough, I found shadow copies working perfectly fine, without changing anything in the config. No idea why it didn't work before, my best guess is that one of the recent samba patches fixed some underlying issue. I'm on Ubuntu 16.04 and it's still early days so a lot of bugfixes are being pushed out almost daily... So, for the record, the smb config settings posted in this thread seem to be working great on 16.04/Samba version 4.3.9-Ubuntu. |
Hello, In our case the problem was the format of the date/time. My experience: I have manually changed in the script "zfs-auto-snapshot" the line Our smb.conf: Now iam happy. regards |
any possibility for a config for this so we don't have to pull in another repo? via https://github.com/zfsonlinux/zfs-auto-snapshot/wiki/Samba |
Provide an option to hook automatic snapshots into Samba like this:
The text was updated successfully, but these errors were encountered: