[Samba] how to backup samba ad domain

Jules Houantonon juleshoueto at gmail.com
Tue Jul 26 22:01:34 UTC 2016


Anderson,

your script works, it backup etc and the content of /var/lib.

I just needed to ajust the samba service script to mine.

Thank you for your time also.

Regards

On Tue, Jul 26, 2016 at 5:28 PM, Anderson Hoffmann do Carmo <
anderson.hoffmann at gsurfnet.com> wrote:

> I have one DC in Samba 4.3.9-Ubuntu Server
> I set the backup script and it is working properly!
> The restore test it is OK for me!
> I scheduled via CRON and the backup takes one minute only to run
>
>
> *#!/bin/bash*
> *####################################*
> *#*
> *# Samba_AD backup script*
> *#*
> *####################################*
>
> *# Stop Samba*
> */etc/init.d/samba stop*
>
> *# What to backup*
> *backup_files="/etc/samba /var/lib/samba"*
>
> *# Where to backup to*
> *dest="/BACKUP"*
>
> *# Create archive filename*
> *day=$(date +%Y_%m_%d_%H%M)*
> *hostname=$(hostname -s)*
> *archive_file="$hostname-$day.tgz"*
>
> *# Backup the files using tar*
> *tar --acls --xattrs -czf $dest/$archive_file $backup_files*
>
> *# Start Samba*
> */etc/init.d/samba start*
>
>
>
>
> Anderson Hoffmann do Carmo
> MCP | MTA | MCDST | MCTS | MCSA | MS | MOS |
> ITIL-F | ISFS | CLOUDF | CI-SCS | VCA-DCV |
>
>
>
> 2016-07-26 12:01 GMT-03:00 Jules Houantonon <juleshoueto at gmail.com>:
>
> > Hi all,
> >
> > as for samba sernet installation, the etc direction is located in to /etc
> > and the private in to /var/lib/samba, as the sysvol to /var/lib/samba
> also,
> >
> > i adjust the parameter FROMWHERE=/usr/local/samba to :
> >
> > FROMWHERE=/etc/samba
> > FROMWHERE=/var/lib/samba/private
> > FROMWHERE=/usr/local/samba/sysvol
> > WHERE=/usr/local/backups
> >
> > When I run the script , i receive a tar error that said :
> >
> > tar refuse to create an empty file
> > Error while archiving /usr/local/backups/samba4_private.2016_7_26.tar.bz2
> > -status=2
> >
> > I though /usr/local/backups is the destination for backup files that will
> > be created.
> > For me, It seems that the script is looking for files in
> /usr/local/backups
> > and as it is a empty directory, it is rejected.
> >
> > Thank you for your time and helping
> >
> > Regards
> >
> >
> >
> > On Tue, Jul 26, 2016 at 3:38 PM, L.P.H. van Belle <belle at bazuin.nl>
> wrote:
> >
> > > Hai Kevin,
> > >
> > > I to have more dc's but same as what your saying..
> > > > In general that's fine if all you care about is being able to
> recreate
> > a
> > > > failed DC (after hardware failure or bad system update). It's no use
> in
> > > > protecting you against user/sysadmin error where you make large, but
> > > > unwanted changes to your directory (like accidentally deleting 200
> > users)
> > > > and you want to reset it to the previous day's state.
> > >
> > > For that, check :
> > > https://github.com/thctlo/samba4
> > >
> > > and run it in cron as much u want.
> > >
> > > Result is like what you want, im ok with 5 backups a day.
> > > (next to the normal backups)
> > >
> > > >ls
> > > samba-2016-07-18-0.tar.bz2
> > > samba-2016-07-18-1.tar.bz2
> > > samba-2016-07-18-2.tar.bz2
> > > samba-2016-07-18-3.tar.bz2
> > > samba-2016-07-18-4.tar.bz2
> > >
> > > samba-2016-07-19-0.tar.bz2
> > > samba-2016-07-19-1.tar.bz2
> > > samba-2016-07-19-2.tar.bz2
> > > samba-2016-07-19-3.tar.bz2
> > > samba-2016-07-19-4.tar.bz2
> > >
> > >
> > > Greetz,
> > >
> > > Louis
> > >
> > >
> > >
> > > --
> > > To unsubscribe from this list go to the following URL and read the
> > > instructions:  https://lists.samba.org/mailman/options/samba
> > >
> >
> >
> >
> > --
> > Jules HOUANTONON
> > *Phone* : (00229) 97578914
> > *Email *: juleshoueto at gmail.com
> > *Skype* : houantonon
> > *linkedin* : www.linkedin.com/in/jhouantonon/en
> > --
> > To unsubscribe from this list go to the following URL and read the
> > instructions:  https://lists.samba.org/mailman/options/samba
> >
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
>



-- 
Jules HOUANTONON
*Phone* : (00229) 97578914
*Email *: juleshoueto at gmail.com
*Skype* : houantonon
*linkedin* : www.linkedin.com/in/jhouantonon/en


More information about the samba mailing list