Discussion:
[Samba] how to backup samba ad domain
Jules Houantonon
2016-07-26 10:16:35 UTC
Permalink
Dear all,

i installed samba-sernet-ad on centos 7.2.

I read that samba_backup script it is available from the source code.

As, i do not installed samba from source code, how can i backup Samba AD on
my server ?

Thank you for helping

Regards
--
Jules HOUANTONON
*Phone* : (00229) 97578914
*Email *: ***@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
mathias dufresne
2016-07-26 10:47:19 UTC
Permalink
By downloading the source and extracting the script?

More seriously, there are lot of ways to achieve backup of Samba AD. Chose
one, that one will be the good one.

The point regarding backup is not backup, but restoration. Here it's a bit
more complex as some files are hard links (when using Bind+DLZ as DNS back
end). Rights must also be set correctly. But that's almost easy.
During restoration of AD all DC must be stopped because all DC would try to
synchronize with the newly restored DC. Once that first step is done, you
will need to join each others DC to the restored one. Once again, this
re-join must be done with Samba services stopped (on joined client, not on
the restored one of course).

Backup / restoration is on my todo list, these were only thoughts assembled
during last months in expectation I reach one day that line of my todo list
: )
Post by Jules Houantonon
Dear all,
i installed samba-sernet-ad on centos 7.2.
I read that samba_backup script it is available from the source code.
As, i do not installed samba from source code, how can i backup Samba AD on
my server ?
Thank you for helping
Regards
--
Jules HOUANTONON
*Phone* : (00229) 97578914
*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
2016-07-26 11:51:37 UTC
Permalink
Thank you all for your feedback. I appreciate it.

I only have one DC, and i cannot install another one.

Please, now how can I adjust the backup script to work witch samba-sernet
package installation ?

Regards
Post by Jules Houantonon
Dear all,
i installed samba-sernet-ad on centos 7.2.
I read that samba_backup script it is available from the source code.
As, i do not installed samba from source code, how can i backup Samba AD on
my server ?
Thank you for helping
Regards
The problem with getting the backup script from the source code is that it
is hardcoded for /usr/local/samba.
You only really need a backup script if you only have one DC, the best way
to backup your AD, add another DC.
If you do decide to backup your AD, you will have to decide when and how
often you create a backup, this is because infrequent backups are
worthless. Unless you are sure that your backup contains every change, you
could find yourself minus all changes made since the last backup.
Rowland
--
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 *: ***@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
L.P.H. van Belle
2016-07-26 12:32:34 UTC
Permalink
Hi,

To save you guys some time.
Im not a github guru so, ignore the layout please..

I'm posting scipts in the future here.
https://github.com/thctlo/samba4

For now i added the backup_samba4 script which i use daily.
Rowland Penny and me did modify it.


Greetz,

Louis
-----Oorspronkelijk bericht-----
Verzonden: dinsdag 26 juli 2016 13:52
Aan: Rowland penny
CC: samba
Onderwerp: Re: [Samba] how to backup samba ad domain
Thank you all for your feedback. I appreciate it.
I only have one DC, and i cannot install another one.
Please, now how can I adjust the backup script to work witch samba-sernet
package installation ?
Regards
Post by Jules Houantonon
Dear all,
i installed samba-sernet-ad on centos 7.2.
I read that samba_backup script it is available from the source code.
As, i do not installed samba from source code, how can i backup Samba
AD
Post by Jules Houantonon
on
my server ?
Thank you for helping
Regards
The problem with getting the backup script from the source code is that
it
is hardcoded for /usr/local/samba.
You only really need a backup script if you only have one DC, the best
way
to backup your AD, add another DC.
If you do decide to backup your AD, you will have to decide when and how
often you create a backup, this is because infrequent backups are
worthless. Unless you are sure that your backup contains every change,
you
could find yourself minus all changes made since the last backup.
Rowland
--
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
*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
Kevin Davidson
2016-07-26 14:22:02 UTC
Permalink
You only really need a backup script if you only have one DC, the best way to backup your AD, add another DC.
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.

If your second DC is offsite it might form part of your disaster recovery plan.


Sent from my iPhone
--
Kevin Davidson
Apple Certified System Administrator
Technical Director

t 01506 668674
m 07813 149620
w www.indigospring.co.uk

indigospring (Scotland) Ltd
Registered in Scotland No. SC398572
Registered office: 103 Oldwood Place, Livingston EH54 6US

Follow us on Twitter - twitter.com/indigospringIT
Members of the Apple Consultants Network - consultants.apple.com/uk

http://www.indigospring.co.uk/terms-and-conditions
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
L.P.H. van Belle
2016-07-26 14:38:51 UTC
Permalink
Hai Kevin,

I to have more dc's but same as what your saying..
Post by Kevin Davidson
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)
Post by Kevin Davidson
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
2016-07-26 15:01:00 UTC
Permalink
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
Post by L.P.H. van Belle
Hai Kevin,
I to have more dc's but same as what your saying..
Post by Kevin Davidson
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.
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)
Post by Kevin Davidson
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 *: ***@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
Anderson Hoffmann do Carmo
2016-07-26 16:28:04 UTC
Permalink
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 |
Post by Jules Houantonon
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,
FROMWHERE=/etc/samba
FROMWHERE=/var/lib/samba/private
FROMWHERE=/usr/local/samba/sysvol
WHERE=/usr/local/backups
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
Post by L.P.H. van Belle
Hai Kevin,
I to have more dc's but same as what your saying..
Post by Kevin Davidson
In general that's fine if all you care about is being able to recreate
a
Post by L.P.H. van Belle
Post by Kevin Davidson
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)
Post by L.P.H. van Belle
Post by Kevin Davidson
and you want to reset it to the previous day's state.
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)
Post by Kevin Davidson
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
*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
2016-07-26 22:01:34 UTC
Permalink
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 <
Post by Anderson Hoffmann do Carmo
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 |
Post by Jules Houantonon
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,
Post by Jules Houantonon
FROMWHERE=/etc/samba
FROMWHERE=/var/lib/samba/private
FROMWHERE=/usr/local/samba/sysvol
WHERE=/usr/local/backups
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
Post by Jules Houantonon
and as it is a empty directory, it is rejected.
Thank you for your time and helping
Regards
Post by L.P.H. van Belle
Hai Kevin,
I to have more dc's but same as what your saying..
Post by Kevin Davidson
In general that's fine if all you care about is being able to
recreate
Post by Jules Houantonon
a
Post by L.P.H. van Belle
Post by Kevin Davidson
failed DC (after hardware failure or bad system update). It's no use
in
Post by Jules Houantonon
Post by L.P.H. van Belle
Post by Kevin Davidson
protecting you against user/sysadmin error where you make large, but
unwanted changes to your directory (like accidentally deleting 200
users)
Post by L.P.H. van Belle
Post by Kevin Davidson
and you want to reset it to the previous day's state.
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)
Post by Kevin Davidson
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
*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 *: ***@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
Jules Houantonon
2016-07-26 21:55:00 UTC
Permalink
Dear Rowland,

the result is the same with only one
FROMWHERE=/etc/samba

Thank you
Post by Jules Houantonon
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,
FROMWHERE=/etc/samba
FROMWHERE=/var/lib/samba/private
FROMWHERE=/usr/local/samba/sysvol
WHERE=/usr/local/backups
Which script are you using ?
If it is the standard Samba script, I would think you can only specify
'FROMWHERE' once.
Rowland
Post by Jules Houantonon
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
--
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 *: ***@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
L.P.H. van Belle
2016-07-26 15:11:00 UTC
Permalink
Get the script from github..

https://github.com/thctlo/samba4/tree/master/backup-script

 

and only change these 2.

 

This one is generated by the script, it speeds up the cron job.

SCRIPT_COMMANDS_FILE="/etc/samba/backup_samba4_commands"

 

And the location of where your backups go.

STOREDIR=/home/backups/`hostname –s`

 

Run it and it works ;-) , if not i ow you.. ;-)

 

 

Greetz,

 

Louis

 

 

 


Van: Jules Houantonon [mailto:***@gmail.com]
Verzonden: dinsdag 26 juli 2016 17:01
Aan: L.P.H. van Belle
CC: ***@lists.samba.org; Kevin Davidson
Onderwerp: Re: [Samba] how to backup samba ad domain


 

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 <***@bazuin.nl> wrote:

Hai Kevin,

I to have more dc's but same as what your saying..
Post by Kevin Davidson
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)
Post by Kevin Davidson
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 : ***@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
Jules Houantonon
2016-07-26 21:59:31 UTC
Permalink
My friend,
you ow me a lot then. :D

I receive an error on the line

179 ${CMD_AWK} -F '.' '{print $2}') if [ -n "${TARVERSION}" ] && [ "
${TARVERSION}" -ge "27" ]; then

It is about Incorrect syntaxt. A syntax where not expected before the then.

I am using Centos 7.2 and samba-sernet 4.2

Thank you again
Post by L.P.H. van Belle
Get the script from github..
https://github.com/thctlo/samba4/tree/master/backup-script
and only change these 2.
This one is generated by the script, it speeds up the cron job.
SCRIPT_COMMANDS_FILE="/etc/samba/backup_samba4_commands"
And the location of where your backups go.
STOREDIR=/home/backups/`hostname –s`
Run it and it works ;-) , if not i ow you.. ;-)
Greetz,
Louis
------------------------------
*Verzonden:* dinsdag 26 juli 2016 17:01
*Aan:* L.P.H. van Belle
*Onderwerp:* Re: [Samba] how to backup samba ad domain
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,
FROMWHERE=/etc/samba
FROMWHERE=/var/lib/samba/private
FROMWHERE=/usr/local/samba/sysvol
WHERE=/usr/local/backups
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
Hai Kevin,
I to have more dc's but same as what your saying..
Post by Kevin Davidson
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.
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)
Post by Kevin Davidson
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
*Skype* : houantonon
*linkedin* : www.linkedin.com/in/jhouantonon/en
--
Jules HOUANTONON
*Phone* : (00229) 97578914
*Email *: ***@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
Jules Houantonon
2016-07-26 22:03:04 UTC
Permalink
Dear van Belle,

It will be nice to know why it doesn't work...:)
Post by Jules Houantonon
My friend,
you ow me a lot then. :D
I receive an error on the line
179 ${CMD_AWK} -F '.' '{print $2}') if [ -n "${TARVERSION}" ] && [ "
${TARVERSION}" -ge "27" ]; then
It is about Incorrect syntaxt. A syntax where not expected before the then.
I am using Centos 7.2 and samba-sernet 4.2
Thank you again
Post by L.P.H. van Belle
Get the script from github..
https://github.com/thctlo/samba4/tree/master/backup-script
and only change these 2.
This one is generated by the script, it speeds up the cron job.
SCRIPT_COMMANDS_FILE="/etc/samba/backup_samba4_commands"
And the location of where your backups go.
STOREDIR=/home/backups/`hostname –s`
Run it and it works ;-) , if not i ow you.. ;-)
Greetz,
Louis
------------------------------
*Verzonden:* dinsdag 26 juli 2016 17:01
*Aan:* L.P.H. van Belle
*Onderwerp:* Re: [Samba] how to backup samba ad domain
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,
FROMWHERE=/etc/samba
FROMWHERE=/var/lib/samba/private
FROMWHERE=/usr/local/samba/sysvol
WHERE=/usr/local/backups
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
Hai Kevin,
I to have more dc's but same as what your saying..
Post by Kevin Davidson
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)
Post by Kevin Davidson
and you want to reset it to the previous day's state.
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)
Post by Kevin Davidson
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
*Skype* : houantonon
*linkedin* : www.linkedin.com/in/jhouantonon/en
--
Jules HOUANTONON
*Phone* : (00229) 97578914
*Skype* : houantonon
*linkedin* : www.linkedin.com/in/jhouantonon/en
--
Jules HOUANTONON
*Phone* : (00229) 97578914
*Email *: ***@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
L.P.H. van Belle
2016-07-27 07:58:13 UTC
Permalink
Ai... :-(( i ow lots of people now.. oeps.. .. but thanks anyone for reporting..

Some enters moved while uploaded to github, dont know how/why.

I've corrected the script and added some extra info on the page to make things more clear.

So i would say try again.
https://github.com/thctlo/samba4/tree/master/backup-script


Greetz,

Louis
-----Oorspronkelijk bericht-----
Verzonden: woensdag 27 juli 2016 9:26
Onderwerp: Re: [Samba] how to backup samba ad domain
Post by Jules Houantonon
My friend,
you ow me a lot then. :D
I receive an error on the line
179 ${CMD_AWK} -F '.' '{print $2}') if [ -n "${TARVERSION}" ] && [ "
${TARVERSION}" -ge "27" ]; then
It is about Incorrect syntaxt. A syntax where not expected before the
then.
Post by Jules Houantonon
I am using Centos 7.2 and samba-sernet 4.2
Thank you again
# Test if GNU tar is installed and is the required version or newer
TARVERSION=$(${CMD_TAR} --version | ${CMD_GREP} 'GNU tar' | ${CMD_AWK}
'{print $NF}' | \
${CMD_AWK} -F '.' '{print $2}')
if [ -n "${TARVERSION}" ] && [ "${TARVERSION}" -ge "27" ]; then
TARARGS="--acls --xattrs -cjf"
else
TARARGS="-cjf"
fi
And I know this works (on debian) because I wrote it!
It is supposed to check that the version of 'tar' installed is 'GNU tar'
and the minor version is '27' or greater, if so, backup acls & xattrs.
Rowland
--
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
Loading...