Univention Bugzilla – Full Text Bug Listing |
Summary: | Backup Samba4 Databases | ||
---|---|---|---|
Product: | UCS | Reporter: | Arvid Requate <requate> |
Component: | Samba4 | Assignee: | Felix Botner <botner> |
Status: | CLOSED FIXED | QA Contact: | Arvid Requate <requate> |
Severity: | enhancement | ||
Priority: | P1 | CC: | gohmann, jmm, petersen, steuwer |
Version: | UCS 3.2 | ||
Target Milestone: | UCS 3.2-1-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
What kind of report is it?: | --- | What type of bug is this?: | --- |
Who will be affected by this bug?: | --- | How will those affected feel about the bug?: | --- |
User Pain: | Enterprise Customer affected?: | ||
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | Bug group (optional): | ||
Max CVSS v3 score: | |||
Bug Depends on: | |||
Bug Blocks: | 56505, 53729 |
Description
Arvid Requate
2014-02-12 18:38:29 CET
root@master40:~# du -sh /tmp/samba-backup/* 68K /tmp/samba-backup/hklm.ldb.bak 100K /tmp/samba-backup/idmap.ldb.bak 60K /tmp/samba-backup/privilege.ldb.bak 2,9M /tmp/samba-backup/sam.ldb.bak 21M /tmp/samba-backup/sam.ldb.d 64K /tmp/samba-backup/secrets.ldb.bak 84K /tmp/samba-backup/share.ldb.bak 52K /tmp/samba-backup/wins_config.ldb.bak root@master40:~# du -sh /tmp/samba-backup/sam.ldb.d/* 8,2M /tmp/samba-backup/sam.ldb.d/CN=CONFIGURATION,DC=AR320I1,DC=QA.ldb.bak 7,7M /tmp/samba-backup/sam.ldb.d/CN=SCHEMA,CN=CONFIGURATION,DC=AR320I1,DC=QA.ldb.bak 1,9M /tmp/samba-backup/sam.ldb.d/DC=AR320I1,DC=QA.ldb.bak 400K /tmp/samba-backup/sam.ldb.d/DC=DOMAINDNSZONES,DC=AR320I1,DC=QA.ldb.bak 2,9M /tmp/samba-backup/sam.ldb.d/DC=FORESTDNSZONES,DC=AR320I1,DC=QA.ldb.bak Compression boils this down to a reasonable size: root@master40:~# tar cjvf samba-backup.tar.bz2 /tmp/samba-backup root@master40:~# du -sh samba-backup.tar.bz2 1,3M samba-backup.tar.bz2 Skipping the CN=SCHEMA Partition cuts this even more, but that's a pretty constant overhead of about 650K (compressed), which might be negligible compared to the growing sizes of the Domain and Configuration partitons. The drawback of saving ldb in a tar file is that browsing is a bit awkward, and that all the LDB internal index data is contained as well, which is growing with the amount of data and might make up for maybe half of the backend ldb size. We could do a hybrid approach here: * backup the ldbs and tdbs directly under /var/lib/samba/private in raw format These shouldn't take too much space. * save compressed ldifs from the backend sam.ldb.d/*.ldb files (which return all attributes unfiltered) plus some special internal ldb attributes (like @REPLCHANGED and @BASEINFO). It all depends on the use case of this periodic (nightly?) backup. If the goal is to provide fast access to yesterdays directory objects, then the ldif part (plus maybe an ldif of secrets.ldb) would be enough and convenient. Couldn't we use a modified version of source4/scripting/bin/samba_backup? See https://wiki.samba.org/index.php/Backup_and_Recovery I think we save the old data for one year (default) and do the backup every night. Added univention-samba4-backup (based on source4/scripting/bin/samba_backup). This script backups everything from /var/lib/samba into a tar file in /var/univention-backup/samba (with tdbbackup for ldb files). The script is executed by the cron job /etc/cron.d/univention-samba4-backup (with 0 3 * * * as default, configurable via samba4/backup/cron) YAML: 2014-03-31-univention-samba4.yaml Ok, works. |